Class TDoubleLinkedList

  • All Implemented Interfaces:
    gnu.trove.list.TDoubleList, gnu.trove.TDoubleCollection, java.io.Externalizable, java.io.Serializable

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

      • Fields inherited from interface gnu.trove.TDoubleCollection

        serialVersionUID
    • Method Summary

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

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

      • TDoubleLinkedList

        public TDoubleLinkedList()
      • TDoubleLinkedList

        public TDoubleLinkedList​(double no_entry_value)
      • TDoubleLinkedList

        public TDoubleLinkedList​(gnu.trove.list.TDoubleList list)
    • Method Detail

      • getNoEntryValue

        public double getNoEntryValue()
        Specified by:
        getNoEntryValue in interface gnu.trove.TDoubleCollection
        Specified by:
        getNoEntryValue in interface gnu.trove.list.TDoubleList
      • size

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

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

        public boolean add​(double val)
        Specified by:
        add in interface gnu.trove.TDoubleCollection
        Specified by:
        add in interface gnu.trove.list.TDoubleList
      • add

        public void add​(double[] vals)
        Specified by:
        add in interface gnu.trove.list.TDoubleList
      • add

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

        public void insert​(int offset,
                           double value)
        Specified by:
        insert in interface gnu.trove.list.TDoubleList
      • insert

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

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

        public double get​(int offset)
        Specified by:
        get in interface gnu.trove.list.TDoubleList
      • getLinkAt

        public gnu.trove.list.linked.TDoubleLinkedList.TDoubleLink 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 double set​(int offset,
                          double val)
        Specified by:
        set in interface gnu.trove.list.TDoubleList
      • set

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

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

        public double replace​(int offset,
                              double val)
        Specified by:
        replace in interface gnu.trove.list.TDoubleList
      • clear

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

        public boolean remove​(double value)
        Specified by:
        remove in interface gnu.trove.TDoubleCollection
        Specified by:
        remove in interface gnu.trove.list.TDoubleList
      • containsAll

        public boolean containsAll​(java.util.Collection<?> collection)
        Specified by:
        containsAll in interface gnu.trove.TDoubleCollection
      • containsAll

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

        public boolean containsAll​(double[] array)
        Specified by:
        containsAll in interface gnu.trove.TDoubleCollection
      • addAll

        public boolean addAll​(java.util.Collection<? extends java.lang.Double> collection)
        Specified by:
        addAll in interface gnu.trove.TDoubleCollection
      • addAll

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

        public boolean addAll​(double[] array)
        Specified by:
        addAll in interface gnu.trove.TDoubleCollection
      • retainAll

        public boolean retainAll​(java.util.Collection<?> collection)
        Specified by:
        retainAll in interface gnu.trove.TDoubleCollection
      • retainAll

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

        public boolean retainAll​(double[] array)
        Specified by:
        retainAll in interface gnu.trove.TDoubleCollection
      • removeAll

        public boolean removeAll​(java.util.Collection<?> collection)
        Specified by:
        removeAll in interface gnu.trove.TDoubleCollection
      • removeAll

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

        public boolean removeAll​(double[] array)
        Specified by:
        removeAll in interface gnu.trove.TDoubleCollection
      • removeAt

        public double removeAt​(int offset)
        Specified by:
        removeAt in interface gnu.trove.list.TDoubleList
      • remove

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

        public void transformValues​(gnu.trove.function.TDoubleFunction function)
        Specified by:
        transformValues in interface gnu.trove.list.TDoubleList
      • reverse

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

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

        public void shuffle​(java.util.Random rand)
        Specified by:
        shuffle in interface gnu.trove.list.TDoubleList
      • subList

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

        public double[] toArray()
        Specified by:
        toArray in interface gnu.trove.TDoubleCollection
        Specified by:
        toArray in interface gnu.trove.list.TDoubleList
      • toArray

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

        public double[] toArray​(double[] dest)
        Specified by:
        toArray in interface gnu.trove.TDoubleCollection
        Specified by:
        toArray in interface gnu.trove.list.TDoubleList
      • toArray

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

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

        public boolean forEach​(gnu.trove.procedure.TDoubleProcedure procedure)
        Specified by:
        forEach in interface gnu.trove.TDoubleCollection
        Specified by:
        forEach in interface gnu.trove.list.TDoubleList
      • forEachDescending

        public boolean forEachDescending​(gnu.trove.procedure.TDoubleProcedure procedure)
        Specified by:
        forEachDescending in interface gnu.trove.list.TDoubleList
      • sort

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

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

        public void fill​(double val)
        Specified by:
        fill in interface gnu.trove.list.TDoubleList
      • fill

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

        public int binarySearch​(double value)
        Specified by:
        binarySearch in interface gnu.trove.list.TDoubleList
      • binarySearch

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

        public int indexOf​(double value)
        Specified by:
        indexOf in interface gnu.trove.list.TDoubleList
      • indexOf

        public int indexOf​(int offset,
                           double value)
        Specified by:
        indexOf in interface gnu.trove.list.TDoubleList
      • lastIndexOf

        public int lastIndexOf​(double value)
        Specified by:
        lastIndexOf in interface gnu.trove.list.TDoubleList
      • lastIndexOf

        public int lastIndexOf​(int offset,
                               double value)
        Specified by:
        lastIndexOf in interface gnu.trove.list.TDoubleList
      • contains

        public boolean contains​(double value)
        Specified by:
        contains in interface gnu.trove.TDoubleCollection
        Specified by:
        contains in interface gnu.trove.list.TDoubleList
      • iterator

        public gnu.trove.iterator.TDoubleIterator iterator()
        Specified by:
        iterator in interface gnu.trove.TDoubleCollection
      • grep

        public gnu.trove.list.TDoubleList grep​(gnu.trove.procedure.TDoubleProcedure condition)
        Specified by:
        grep in interface gnu.trove.list.TDoubleList
      • inverseGrep

        public gnu.trove.list.TDoubleList inverseGrep​(gnu.trove.procedure.TDoubleProcedure condition)
        Specified by:
        inverseGrep in interface gnu.trove.list.TDoubleList
      • max

        public double max()
        Specified by:
        max in interface gnu.trove.list.TDoubleList
      • min

        public double min()
        Specified by:
        min in interface gnu.trove.list.TDoubleList
      • sum

        public double sum()
        Specified by:
        sum in interface gnu.trove.list.TDoubleList
      • 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.TDoubleCollection
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

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