Class TCharLinkedList

java.lang.Object
gnu.trove.list.linked.TCharLinkedList
All Implemented Interfaces:
gnu.trove.list.TCharList, gnu.trove.TCharCollection, Externalizable, Serializable

public class TCharLinkedList extends Object implements gnu.trove.list.TCharList, Externalizable
A resizable, double linked list of char primitives.
See Also:
  • Constructor Details

    • TCharLinkedList

      public TCharLinkedList()
    • TCharLinkedList

      public TCharLinkedList(char no_entry_value)
    • TCharLinkedList

      public TCharLinkedList(gnu.trove.list.TCharList list)
  • Method Details

    • getNoEntryValue

      public char getNoEntryValue()
      Specified by:
      getNoEntryValue in interface gnu.trove.TCharCollection
      Specified by:
      getNoEntryValue in interface gnu.trove.list.TCharList
    • size

      public int size()
      Specified by:
      size in interface gnu.trove.TCharCollection
      Specified by:
      size in interface gnu.trove.list.TCharList
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface gnu.trove.TCharCollection
      Specified by:
      isEmpty in interface gnu.trove.list.TCharList
    • add

      public boolean add(char val)
      Specified by:
      add in interface gnu.trove.TCharCollection
      Specified by:
      add in interface gnu.trove.list.TCharList
    • add

      public void add(char[] vals)
      Specified by:
      add in interface gnu.trove.list.TCharList
    • add

      public void add(char[] vals, int offset, int length)
      Specified by:
      add in interface gnu.trove.list.TCharList
    • insert

      public void insert(int offset, char value)
      Specified by:
      insert in interface gnu.trove.list.TCharList
    • insert

      public void insert(int offset, char[] values)
      Specified by:
      insert in interface gnu.trove.list.TCharList
    • insert

      public void insert(int offset, char[] values, int valOffset, int len)
      Specified by:
      insert in interface gnu.trove.list.TCharList
    • get

      public char get(int offset)
      Specified by:
      get in interface gnu.trove.list.TCharList
    • getLinkAt

      public gnu.trove.list.linked.TCharLinkedList.TCharLink getLinkAt(int offset)

      Returns the link at the given offset.

      A simple bisection criteria is used to keep the worst case complexity equal to O(n/2) where n = size(). Simply start from head of list or tail depending on offset and list size.

      Parameters:
      offset - of the link
      Returns:
      link or null if non-existent
    • set

      public char set(int offset, char val)
      Specified by:
      set in interface gnu.trove.list.TCharList
    • set

      public void set(int offset, char[] values)
      Specified by:
      set in interface gnu.trove.list.TCharList
    • set

      public void set(int offset, char[] values, int valOffset, int length)
      Specified by:
      set in interface gnu.trove.list.TCharList
    • replace

      public char replace(int offset, char val)
      Specified by:
      replace in interface gnu.trove.list.TCharList
    • clear

      public void clear()
      Specified by:
      clear in interface gnu.trove.TCharCollection
      Specified by:
      clear in interface gnu.trove.list.TCharList
    • remove

      public boolean remove(char value)
      Specified by:
      remove in interface gnu.trove.TCharCollection
      Specified by:
      remove in interface gnu.trove.list.TCharList
    • containsAll

      public boolean containsAll(Collection<?> collection)
      Specified by:
      containsAll in interface gnu.trove.TCharCollection
    • containsAll

      public boolean containsAll(gnu.trove.TCharCollection collection)
      Specified by:
      containsAll in interface gnu.trove.TCharCollection
    • containsAll

      public boolean containsAll(char[] array)
      Specified by:
      containsAll in interface gnu.trove.TCharCollection
    • addAll

      public boolean addAll(Collection<? extends Character> collection)
      Specified by:
      addAll in interface gnu.trove.TCharCollection
    • addAll

      public boolean addAll(gnu.trove.TCharCollection collection)
      Specified by:
      addAll in interface gnu.trove.TCharCollection
    • addAll

      public boolean addAll(char[] array)
      Specified by:
      addAll in interface gnu.trove.TCharCollection
    • retainAll

      public boolean retainAll(Collection<?> collection)
      Specified by:
      retainAll in interface gnu.trove.TCharCollection
    • retainAll

      public boolean retainAll(gnu.trove.TCharCollection collection)
      Specified by:
      retainAll in interface gnu.trove.TCharCollection
    • retainAll

      public boolean retainAll(char[] array)
      Specified by:
      retainAll in interface gnu.trove.TCharCollection
    • removeAll

      public boolean removeAll(Collection<?> collection)
      Specified by:
      removeAll in interface gnu.trove.TCharCollection
    • removeAll

      public boolean removeAll(gnu.trove.TCharCollection collection)
      Specified by:
      removeAll in interface gnu.trove.TCharCollection
    • removeAll

      public boolean removeAll(char[] array)
      Specified by:
      removeAll in interface gnu.trove.TCharCollection
    • removeAt

      public char removeAt(int offset)
      Specified by:
      removeAt in interface gnu.trove.list.TCharList
    • remove

      public void remove(int offset, int length)
      Specified by:
      remove in interface gnu.trove.list.TCharList
    • transformValues

      public void transformValues(gnu.trove.function.TCharFunction function)
      Specified by:
      transformValues in interface gnu.trove.list.TCharList
    • reverse

      public void reverse()
      Specified by:
      reverse in interface gnu.trove.list.TCharList
    • reverse

      public void reverse(int from, int to)
      Specified by:
      reverse in interface gnu.trove.list.TCharList
    • shuffle

      public void shuffle(Random rand)
      Specified by:
      shuffle in interface gnu.trove.list.TCharList
    • subList

      public gnu.trove.list.TCharList subList(int begin, int end)
      Specified by:
      subList in interface gnu.trove.list.TCharList
    • toArray

      public char[] toArray()
      Specified by:
      toArray in interface gnu.trove.TCharCollection
      Specified by:
      toArray in interface gnu.trove.list.TCharList
    • toArray

      public char[] toArray(int offset, int len)
      Specified by:
      toArray in interface gnu.trove.list.TCharList
    • toArray

      public char[] toArray(char[] dest)
      Specified by:
      toArray in interface gnu.trove.TCharCollection
      Specified by:
      toArray in interface gnu.trove.list.TCharList
    • toArray

      public char[] toArray(char[] dest, int offset, int len)
      Specified by:
      toArray in interface gnu.trove.list.TCharList
    • toArray

      public char[] toArray(char[] dest, int source_pos, int dest_pos, int len)
      Specified by:
      toArray in interface gnu.trove.list.TCharList
    • forEach

      public boolean forEach(gnu.trove.procedure.TCharProcedure procedure)
      Specified by:
      forEach in interface gnu.trove.TCharCollection
      Specified by:
      forEach in interface gnu.trove.list.TCharList
    • forEachDescending

      public boolean forEachDescending(gnu.trove.procedure.TCharProcedure procedure)
      Specified by:
      forEachDescending in interface gnu.trove.list.TCharList
    • sort

      public void sort()
      Specified by:
      sort in interface gnu.trove.list.TCharList
    • sort

      public void sort(int fromIndex, int toIndex)
      Specified by:
      sort in interface gnu.trove.list.TCharList
    • fill

      public void fill(char val)
      Specified by:
      fill in interface gnu.trove.list.TCharList
    • fill

      public void fill(int fromIndex, int toIndex, char val)
      Specified by:
      fill in interface gnu.trove.list.TCharList
    • binarySearch

      public int binarySearch(char value)
      Specified by:
      binarySearch in interface gnu.trove.list.TCharList
    • binarySearch

      public int binarySearch(char value, int fromIndex, int toIndex)
      Specified by:
      binarySearch in interface gnu.trove.list.TCharList
    • indexOf

      public int indexOf(char value)
      Specified by:
      indexOf in interface gnu.trove.list.TCharList
    • indexOf

      public int indexOf(int offset, char value)
      Specified by:
      indexOf in interface gnu.trove.list.TCharList
    • lastIndexOf

      public int lastIndexOf(char value)
      Specified by:
      lastIndexOf in interface gnu.trove.list.TCharList
    • lastIndexOf

      public int lastIndexOf(int offset, char value)
      Specified by:
      lastIndexOf in interface gnu.trove.list.TCharList
    • contains

      public boolean contains(char value)
      Specified by:
      contains in interface gnu.trove.TCharCollection
      Specified by:
      contains in interface gnu.trove.list.TCharList
    • iterator

      public gnu.trove.iterator.TCharIterator iterator()
      Specified by:
      iterator in interface gnu.trove.TCharCollection
    • grep

      public gnu.trove.list.TCharList grep(gnu.trove.procedure.TCharProcedure condition)
      Specified by:
      grep in interface gnu.trove.list.TCharList
    • inverseGrep

      public gnu.trove.list.TCharList inverseGrep(gnu.trove.procedure.TCharProcedure condition)
      Specified by:
      inverseGrep in interface gnu.trove.list.TCharList
    • max

      public char max()
      Specified by:
      max in interface gnu.trove.list.TCharList
    • min

      public char min()
      Specified by:
      min in interface gnu.trove.list.TCharList
    • sum

      public char sum()
      Specified by:
      sum in interface gnu.trove.list.TCharList
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException
    • equals

      public boolean equals(Object other)
      Specified by:
      equals in interface gnu.trove.TCharCollection
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface gnu.trove.TCharCollection
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object