Class TLongLinkedList

  • All Implemented Interfaces:
    gnu.trove.list.TLongList, gnu.trove.TLongCollection, java.io.Externalizable, java.io.Serializable

    public class TLongLinkedList
    extends java.lang.Object
    implements gnu.trove.list.TLongList, java.io.Externalizable
    A resizable, double linked list of long primitives.
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from interface gnu.trove.TLongCollection

        serialVersionUID
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(long val)
      void add​(long[] vals)
      void add​(long[] vals, int offset, int length)
      boolean addAll​(long[] array)
      boolean addAll​(gnu.trove.TLongCollection collection)
      boolean addAll​(java.util.Collection<? extends java.lang.Long> collection)
      int binarySearch​(long value)
      int binarySearch​(long value, int fromIndex, int toIndex)
      void clear()
      boolean contains​(long value)
      boolean containsAll​(long[] array)
      boolean containsAll​(gnu.trove.TLongCollection collection)
      boolean containsAll​(java.util.Collection<?> collection)
      boolean equals​(java.lang.Object other)
      void fill​(int fromIndex, int toIndex, long val)
      void fill​(long val)
      boolean forEach​(gnu.trove.procedure.TLongProcedure procedure)
      boolean forEachDescending​(gnu.trove.procedure.TLongProcedure procedure)
      long get​(int offset)
      gnu.trove.list.linked.TLongLinkedList.TLongLink getLinkAt​(int offset)
      Returns the link at the given offset.
      long getNoEntryValue()
      gnu.trove.list.TLongList grep​(gnu.trove.procedure.TLongProcedure condition)
      int hashCode()
      int indexOf​(int offset, long value)
      int indexOf​(long value)
      void insert​(int offset, long value)
      void insert​(int offset, long[] values)
      void insert​(int offset, long[] values, int valOffset, int len)
      gnu.trove.list.TLongList inverseGrep​(gnu.trove.procedure.TLongProcedure condition)
      boolean isEmpty()
      gnu.trove.iterator.TLongIterator iterator()
      int lastIndexOf​(int offset, long value)
      int lastIndexOf​(long value)
      long max()
      long min()
      void readExternal​(java.io.ObjectInput in)
      void remove​(int offset, int length)
      boolean remove​(long value)
      boolean removeAll​(long[] array)
      boolean removeAll​(gnu.trove.TLongCollection collection)
      boolean removeAll​(java.util.Collection<?> collection)
      long removeAt​(int offset)
      long replace​(int offset, long val)
      boolean retainAll​(long[] array)
      boolean retainAll​(gnu.trove.TLongCollection collection)
      boolean retainAll​(java.util.Collection<?> collection)
      void reverse()
      void reverse​(int from, int to)
      long set​(int offset, long val)
      void set​(int offset, long[] values)
      void set​(int offset, long[] values, int valOffset, int length)
      void shuffle​(java.util.Random rand)
      int size()
      void sort()
      void sort​(int fromIndex, int toIndex)
      gnu.trove.list.TLongList subList​(int begin, int end)
      long sum()
      long[] toArray()
      long[] toArray​(int offset, int len)
      long[] toArray​(long[] dest)
      long[] toArray​(long[] dest, int offset, int len)
      long[] toArray​(long[] dest, int source_pos, int dest_pos, int len)
      java.lang.String toString()  
      void transformValues​(gnu.trove.function.TLongFunction function)
      void writeExternal​(java.io.ObjectOutput out)
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TLongLinkedList

        public TLongLinkedList()
      • TLongLinkedList

        public TLongLinkedList​(long no_entry_value)
      • TLongLinkedList

        public TLongLinkedList​(gnu.trove.list.TLongList list)
    • Method Detail

      • 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​(java.util.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​(java.util.Collection<? extends java.lang.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​(java.util.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​(java.util.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​(java.util.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​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • equals

        public boolean equals​(java.lang.Object other)
        Specified by:
        equals in interface gnu.trove.TLongCollection
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object