Class TLongLinkedList

java.lang.Object
gnu.trove.list.linked.TLongLinkedList
All Implemented Interfaces:
gnu.trove.list.TLongList, gnu.trove.TLongCollection, Externalizable, Serializable

public class TLongLinkedList extends Object implements gnu.trove.list.TLongList, Externalizable
A resizable, double linked list of long primitives.
See Also:
  • Constructor Details

    • TLongLinkedList

      public TLongLinkedList()
    • TLongLinkedList

      public TLongLinkedList(long no_entry_value)
    • TLongLinkedList

      public TLongLinkedList(gnu.trove.list.TLongList list)
  • Method Details

    • getNoEntryValue

      public long getNoEntryValue()
      Specified by:
      getNoEntryValue in interface gnu.trove.TLongCollection
      Specified by:
      getNoEntryValue in interface gnu.trove.list.TLongList
    • size

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

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

      public boolean add(long val)
      Specified by:
      add in interface gnu.trove.TLongCollection
      Specified by:
      add in interface gnu.trove.list.TLongList
    • add

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

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

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

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

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

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

      public gnu.trove.list.linked.TLongLinkedList.TLongLink 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 long set(int offset, long val)
      Specified by:
      set in interface gnu.trove.list.TLongList
    • set

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

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

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

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

      public boolean remove(long value)
      Specified by:
      remove in interface gnu.trove.TLongCollection
      Specified by:
      remove in interface gnu.trove.list.TLongList
    • containsAll

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public long[] toArray()
      Specified by:
      toArray in interface gnu.trove.TLongCollection
      Specified by:
      toArray in interface gnu.trove.list.TLongList
    • toArray

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

      public long[] toArray(long[] dest)
      Specified by:
      toArray in interface gnu.trove.TLongCollection
      Specified by:
      toArray in interface gnu.trove.list.TLongList
    • toArray

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

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

      public boolean forEach(gnu.trove.procedure.TLongProcedure procedure)
      Specified by:
      forEach in interface gnu.trove.TLongCollection
      Specified by:
      forEach in interface gnu.trove.list.TLongList
    • forEachDescending

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

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

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

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

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

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

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

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

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

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

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

      public boolean contains(long value)
      Specified by:
      contains in interface gnu.trove.TLongCollection
      Specified by:
      contains in interface gnu.trove.list.TLongList
    • iterator

      public gnu.trove.iterator.TLongIterator iterator()
      Specified by:
      iterator in interface gnu.trove.TLongCollection
    • grep

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

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

      public long max()
      Specified by:
      max in interface gnu.trove.list.TLongList
    • min

      public long min()
      Specified by:
      min in interface gnu.trove.list.TLongList
    • sum

      public long sum()
      Specified by:
      sum in interface gnu.trove.list.TLongList
    • 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.TLongCollection
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object