Package gnu.trove.list.linked
Class TDoubleLinkedList
- java.lang.Object
-
- gnu.trove.list.linked.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.ExternalizableA resizable, double linked list of double primitives.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TDoubleLinkedList()TDoubleLinkedList(double no_entry_value)TDoubleLinkedList(gnu.trove.list.TDoubleList list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(double val)voidadd(double[] vals)voidadd(double[] vals, int offset, int length)booleanaddAll(double[] array)booleanaddAll(gnu.trove.TDoubleCollection collection)booleanaddAll(java.util.Collection<? extends java.lang.Double> collection)intbinarySearch(double value)intbinarySearch(double value, int fromIndex, int toIndex)voidclear()booleancontains(double value)booleancontainsAll(double[] array)booleancontainsAll(gnu.trove.TDoubleCollection collection)booleancontainsAll(java.util.Collection<?> collection)booleanequals(java.lang.Object other)voidfill(double val)voidfill(int fromIndex, int toIndex, double val)booleanforEach(gnu.trove.procedure.TDoubleProcedure procedure)booleanforEachDescending(gnu.trove.procedure.TDoubleProcedure procedure)doubleget(int offset)gnu.trove.list.linked.TDoubleLinkedList.TDoubleLinkgetLinkAt(int offset)Returns the link at the given offset.doublegetNoEntryValue()gnu.trove.list.TDoubleListgrep(gnu.trove.procedure.TDoubleProcedure condition)inthashCode()intindexOf(double value)intindexOf(int offset, double value)voidinsert(int offset, double value)voidinsert(int offset, double[] values)voidinsert(int offset, double[] values, int valOffset, int len)gnu.trove.list.TDoubleListinverseGrep(gnu.trove.procedure.TDoubleProcedure condition)booleanisEmpty()gnu.trove.iterator.TDoubleIteratoriterator()intlastIndexOf(double value)intlastIndexOf(int offset, double value)doublemax()doublemin()voidreadExternal(java.io.ObjectInput in)booleanremove(double value)voidremove(int offset, int length)booleanremoveAll(double[] array)booleanremoveAll(gnu.trove.TDoubleCollection collection)booleanremoveAll(java.util.Collection<?> collection)doubleremoveAt(int offset)doublereplace(int offset, double val)booleanretainAll(double[] array)booleanretainAll(gnu.trove.TDoubleCollection collection)booleanretainAll(java.util.Collection<?> collection)voidreverse()voidreverse(int from, int to)doubleset(int offset, double val)voidset(int offset, double[] values)voidset(int offset, double[] values, int valOffset, int length)voidshuffle(java.util.Random rand)intsize()voidsort()voidsort(int fromIndex, int toIndex)gnu.trove.list.TDoubleListsubList(int begin, int end)doublesum()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.StringtoString()voidtransformValues(gnu.trove.function.TDoubleFunction function)voidwriteExternal(java.io.ObjectOutput out)
-
-
-
Method Detail
-
getNoEntryValue
public double getNoEntryValue()
- Specified by:
getNoEntryValuein interfacegnu.trove.TDoubleCollection- Specified by:
getNoEntryValuein interfacegnu.trove.list.TDoubleList
-
size
public int size()
- Specified by:
sizein interfacegnu.trove.TDoubleCollection- Specified by:
sizein interfacegnu.trove.list.TDoubleList
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacegnu.trove.TDoubleCollection- Specified by:
isEmptyin interfacegnu.trove.list.TDoubleList
-
add
public boolean add(double val)
- Specified by:
addin interfacegnu.trove.TDoubleCollection- Specified by:
addin interfacegnu.trove.list.TDoubleList
-
add
public void add(double[] vals)
- Specified by:
addin interfacegnu.trove.list.TDoubleList
-
add
public void add(double[] vals, int offset, int length)- Specified by:
addin interfacegnu.trove.list.TDoubleList
-
insert
public void insert(int offset, double value)- Specified by:
insertin interfacegnu.trove.list.TDoubleList
-
insert
public void insert(int offset, double[] values)- Specified by:
insertin interfacegnu.trove.list.TDoubleList
-
insert
public void insert(int offset, double[] values, int valOffset, int len)- Specified by:
insertin interfacegnu.trove.list.TDoubleList
-
get
public double get(int offset)
- Specified by:
getin interfacegnu.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:
setin interfacegnu.trove.list.TDoubleList
-
set
public void set(int offset, double[] values)- Specified by:
setin interfacegnu.trove.list.TDoubleList
-
set
public void set(int offset, double[] values, int valOffset, int length)- Specified by:
setin interfacegnu.trove.list.TDoubleList
-
replace
public double replace(int offset, double val)- Specified by:
replacein interfacegnu.trove.list.TDoubleList
-
clear
public void clear()
- Specified by:
clearin interfacegnu.trove.TDoubleCollection- Specified by:
clearin interfacegnu.trove.list.TDoubleList
-
remove
public boolean remove(double value)
- Specified by:
removein interfacegnu.trove.TDoubleCollection- Specified by:
removein interfacegnu.trove.list.TDoubleList
-
containsAll
public boolean containsAll(java.util.Collection<?> collection)
- Specified by:
containsAllin interfacegnu.trove.TDoubleCollection
-
containsAll
public boolean containsAll(gnu.trove.TDoubleCollection collection)
- Specified by:
containsAllin interfacegnu.trove.TDoubleCollection
-
containsAll
public boolean containsAll(double[] array)
- Specified by:
containsAllin interfacegnu.trove.TDoubleCollection
-
addAll
public boolean addAll(java.util.Collection<? extends java.lang.Double> collection)
- Specified by:
addAllin interfacegnu.trove.TDoubleCollection
-
addAll
public boolean addAll(gnu.trove.TDoubleCollection collection)
- Specified by:
addAllin interfacegnu.trove.TDoubleCollection
-
addAll
public boolean addAll(double[] array)
- Specified by:
addAllin interfacegnu.trove.TDoubleCollection
-
retainAll
public boolean retainAll(java.util.Collection<?> collection)
- Specified by:
retainAllin interfacegnu.trove.TDoubleCollection
-
retainAll
public boolean retainAll(gnu.trove.TDoubleCollection collection)
- Specified by:
retainAllin interfacegnu.trove.TDoubleCollection
-
retainAll
public boolean retainAll(double[] array)
- Specified by:
retainAllin interfacegnu.trove.TDoubleCollection
-
removeAll
public boolean removeAll(java.util.Collection<?> collection)
- Specified by:
removeAllin interfacegnu.trove.TDoubleCollection
-
removeAll
public boolean removeAll(gnu.trove.TDoubleCollection collection)
- Specified by:
removeAllin interfacegnu.trove.TDoubleCollection
-
removeAll
public boolean removeAll(double[] array)
- Specified by:
removeAllin interfacegnu.trove.TDoubleCollection
-
removeAt
public double removeAt(int offset)
- Specified by:
removeAtin interfacegnu.trove.list.TDoubleList
-
remove
public void remove(int offset, int length)- Specified by:
removein interfacegnu.trove.list.TDoubleList
-
transformValues
public void transformValues(gnu.trove.function.TDoubleFunction function)
- Specified by:
transformValuesin interfacegnu.trove.list.TDoubleList
-
reverse
public void reverse()
- Specified by:
reversein interfacegnu.trove.list.TDoubleList
-
reverse
public void reverse(int from, int to)- Specified by:
reversein interfacegnu.trove.list.TDoubleList
-
shuffle
public void shuffle(java.util.Random rand)
- Specified by:
shufflein interfacegnu.trove.list.TDoubleList
-
subList
public gnu.trove.list.TDoubleList subList(int begin, int end)- Specified by:
subListin interfacegnu.trove.list.TDoubleList
-
toArray
public double[] toArray()
- Specified by:
toArrayin interfacegnu.trove.TDoubleCollection- Specified by:
toArrayin interfacegnu.trove.list.TDoubleList
-
toArray
public double[] toArray(int offset, int len)- Specified by:
toArrayin interfacegnu.trove.list.TDoubleList
-
toArray
public double[] toArray(double[] dest)
- Specified by:
toArrayin interfacegnu.trove.TDoubleCollection- Specified by:
toArrayin interfacegnu.trove.list.TDoubleList
-
toArray
public double[] toArray(double[] dest, int offset, int len)- Specified by:
toArrayin interfacegnu.trove.list.TDoubleList
-
toArray
public double[] toArray(double[] dest, int source_pos, int dest_pos, int len)- Specified by:
toArrayin interfacegnu.trove.list.TDoubleList
-
forEach
public boolean forEach(gnu.trove.procedure.TDoubleProcedure procedure)
- Specified by:
forEachin interfacegnu.trove.TDoubleCollection- Specified by:
forEachin interfacegnu.trove.list.TDoubleList
-
forEachDescending
public boolean forEachDescending(gnu.trove.procedure.TDoubleProcedure procedure)
- Specified by:
forEachDescendingin interfacegnu.trove.list.TDoubleList
-
sort
public void sort()
- Specified by:
sortin interfacegnu.trove.list.TDoubleList
-
sort
public void sort(int fromIndex, int toIndex)- Specified by:
sortin interfacegnu.trove.list.TDoubleList
-
fill
public void fill(double val)
- Specified by:
fillin interfacegnu.trove.list.TDoubleList
-
fill
public void fill(int fromIndex, int toIndex, double val)- Specified by:
fillin interfacegnu.trove.list.TDoubleList
-
binarySearch
public int binarySearch(double value)
- Specified by:
binarySearchin interfacegnu.trove.list.TDoubleList
-
binarySearch
public int binarySearch(double value, int fromIndex, int toIndex)- Specified by:
binarySearchin interfacegnu.trove.list.TDoubleList
-
indexOf
public int indexOf(double value)
- Specified by:
indexOfin interfacegnu.trove.list.TDoubleList
-
indexOf
public int indexOf(int offset, double value)- Specified by:
indexOfin interfacegnu.trove.list.TDoubleList
-
lastIndexOf
public int lastIndexOf(double value)
- Specified by:
lastIndexOfin interfacegnu.trove.list.TDoubleList
-
lastIndexOf
public int lastIndexOf(int offset, double value)- Specified by:
lastIndexOfin interfacegnu.trove.list.TDoubleList
-
contains
public boolean contains(double value)
- Specified by:
containsin interfacegnu.trove.TDoubleCollection- Specified by:
containsin interfacegnu.trove.list.TDoubleList
-
iterator
public gnu.trove.iterator.TDoubleIterator iterator()
- Specified by:
iteratorin interfacegnu.trove.TDoubleCollection
-
grep
public gnu.trove.list.TDoubleList grep(gnu.trove.procedure.TDoubleProcedure condition)
- Specified by:
grepin interfacegnu.trove.list.TDoubleList
-
inverseGrep
public gnu.trove.list.TDoubleList inverseGrep(gnu.trove.procedure.TDoubleProcedure condition)
- Specified by:
inverseGrepin interfacegnu.trove.list.TDoubleList
-
max
public double max()
- Specified by:
maxin interfacegnu.trove.list.TDoubleList
-
min
public double min()
- Specified by:
minin interfacegnu.trove.list.TDoubleList
-
sum
public double sum()
- Specified by:
sumin interfacegnu.trove.list.TDoubleList
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
equals
public boolean equals(java.lang.Object other)
- Specified by:
equalsin interfacegnu.trove.TDoubleCollection- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacegnu.trove.TDoubleCollection- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-