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
,Externalizable
,Serializable
A resizable, double linked list of double primitives.
- See Also:
-
Field Summary
Fields inherited from interface gnu.trove.TDoubleCollection
serialVersionUID
-
Constructor Summary
ConstructorsConstructorDescriptionTDoubleLinkedList
(double no_entry_value) TDoubleLinkedList
(gnu.trove.list.TDoubleList list) -
Method Summary
Modifier and TypeMethodDescriptionboolean
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
(Collection<? extends 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
(Collection<?> collection) boolean
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
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
boolean
remove
(double value) void
remove
(int offset, int length) boolean
removeAll
(double[] array) boolean
removeAll
(gnu.trove.TDoubleCollection collection) boolean
removeAll
(Collection<?> collection) double
removeAt
(int offset) double
replace
(int offset, double val) boolean
retainAll
(double[] array) boolean
retainAll
(gnu.trove.TDoubleCollection collection) boolean
retainAll
(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
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) toString()
void
transformValues
(gnu.trove.function.TDoubleFunction function) void
-
Constructor Details
-
TDoubleLinkedList
public TDoubleLinkedList() -
TDoubleLinkedList
public TDoubleLinkedList(double no_entry_value) -
TDoubleLinkedList
public TDoubleLinkedList(gnu.trove.list.TDoubleList list)
-
-
Method Details
-
getNoEntryValue
public double getNoEntryValue()- Specified by:
getNoEntryValue
in interfacegnu.trove.TDoubleCollection
- Specified by:
getNoEntryValue
in interfacegnu.trove.list.TDoubleList
-
size
public int size()- Specified by:
size
in interfacegnu.trove.TDoubleCollection
- Specified by:
size
in interfacegnu.trove.list.TDoubleList
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfacegnu.trove.TDoubleCollection
- Specified by:
isEmpty
in interfacegnu.trove.list.TDoubleList
-
add
public boolean add(double val) - Specified by:
add
in interfacegnu.trove.TDoubleCollection
- Specified by:
add
in interfacegnu.trove.list.TDoubleList
-
add
public void add(double[] vals) - Specified by:
add
in interfacegnu.trove.list.TDoubleList
-
add
public void add(double[] vals, int offset, int length) - Specified by:
add
in interfacegnu.trove.list.TDoubleList
-
insert
public void insert(int offset, double value) - Specified by:
insert
in interfacegnu.trove.list.TDoubleList
-
insert
public void insert(int offset, double[] values) - Specified by:
insert
in interfacegnu.trove.list.TDoubleList
-
insert
public void insert(int offset, double[] values, int valOffset, int len) - Specified by:
insert
in interfacegnu.trove.list.TDoubleList
-
get
public double get(int offset) - Specified by:
get
in 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:
set
in interfacegnu.trove.list.TDoubleList
-
set
public void set(int offset, double[] values) - Specified by:
set
in interfacegnu.trove.list.TDoubleList
-
set
public void set(int offset, double[] values, int valOffset, int length) - Specified by:
set
in interfacegnu.trove.list.TDoubleList
-
replace
public double replace(int offset, double val) - Specified by:
replace
in interfacegnu.trove.list.TDoubleList
-
clear
public void clear()- Specified by:
clear
in interfacegnu.trove.TDoubleCollection
- Specified by:
clear
in interfacegnu.trove.list.TDoubleList
-
remove
public boolean remove(double value) - Specified by:
remove
in interfacegnu.trove.TDoubleCollection
- Specified by:
remove
in interfacegnu.trove.list.TDoubleList
-
containsAll
- Specified by:
containsAll
in interfacegnu.trove.TDoubleCollection
-
containsAll
public boolean containsAll(gnu.trove.TDoubleCollection collection) - Specified by:
containsAll
in interfacegnu.trove.TDoubleCollection
-
containsAll
public boolean containsAll(double[] array) - Specified by:
containsAll
in interfacegnu.trove.TDoubleCollection
-
addAll
- Specified by:
addAll
in interfacegnu.trove.TDoubleCollection
-
addAll
public boolean addAll(gnu.trove.TDoubleCollection collection) - Specified by:
addAll
in interfacegnu.trove.TDoubleCollection
-
addAll
public boolean addAll(double[] array) - Specified by:
addAll
in interfacegnu.trove.TDoubleCollection
-
retainAll
- Specified by:
retainAll
in interfacegnu.trove.TDoubleCollection
-
retainAll
public boolean retainAll(gnu.trove.TDoubleCollection collection) - Specified by:
retainAll
in interfacegnu.trove.TDoubleCollection
-
retainAll
public boolean retainAll(double[] array) - Specified by:
retainAll
in interfacegnu.trove.TDoubleCollection
-
removeAll
- Specified by:
removeAll
in interfacegnu.trove.TDoubleCollection
-
removeAll
public boolean removeAll(gnu.trove.TDoubleCollection collection) - Specified by:
removeAll
in interfacegnu.trove.TDoubleCollection
-
removeAll
public boolean removeAll(double[] array) - Specified by:
removeAll
in interfacegnu.trove.TDoubleCollection
-
removeAt
public double removeAt(int offset) - Specified by:
removeAt
in interfacegnu.trove.list.TDoubleList
-
remove
public void remove(int offset, int length) - Specified by:
remove
in interfacegnu.trove.list.TDoubleList
-
transformValues
public void transformValues(gnu.trove.function.TDoubleFunction function) - Specified by:
transformValues
in interfacegnu.trove.list.TDoubleList
-
reverse
public void reverse()- Specified by:
reverse
in interfacegnu.trove.list.TDoubleList
-
reverse
public void reverse(int from, int to) - Specified by:
reverse
in interfacegnu.trove.list.TDoubleList
-
shuffle
- Specified by:
shuffle
in interfacegnu.trove.list.TDoubleList
-
subList
public gnu.trove.list.TDoubleList subList(int begin, int end) - Specified by:
subList
in interfacegnu.trove.list.TDoubleList
-
toArray
public double[] toArray()- Specified by:
toArray
in interfacegnu.trove.TDoubleCollection
- Specified by:
toArray
in interfacegnu.trove.list.TDoubleList
-
toArray
public double[] toArray(int offset, int len) - Specified by:
toArray
in interfacegnu.trove.list.TDoubleList
-
toArray
public double[] toArray(double[] dest) - Specified by:
toArray
in interfacegnu.trove.TDoubleCollection
- Specified by:
toArray
in interfacegnu.trove.list.TDoubleList
-
toArray
public double[] toArray(double[] dest, int offset, int len) - Specified by:
toArray
in interfacegnu.trove.list.TDoubleList
-
toArray
public double[] toArray(double[] dest, int source_pos, int dest_pos, int len) - Specified by:
toArray
in interfacegnu.trove.list.TDoubleList
-
forEach
public boolean forEach(gnu.trove.procedure.TDoubleProcedure procedure) - Specified by:
forEach
in interfacegnu.trove.TDoubleCollection
- Specified by:
forEach
in interfacegnu.trove.list.TDoubleList
-
forEachDescending
public boolean forEachDescending(gnu.trove.procedure.TDoubleProcedure procedure) - Specified by:
forEachDescending
in interfacegnu.trove.list.TDoubleList
-
sort
public void sort()- Specified by:
sort
in interfacegnu.trove.list.TDoubleList
-
sort
public void sort(int fromIndex, int toIndex) - Specified by:
sort
in interfacegnu.trove.list.TDoubleList
-
fill
public void fill(double val) - Specified by:
fill
in interfacegnu.trove.list.TDoubleList
-
fill
public void fill(int fromIndex, int toIndex, double val) - Specified by:
fill
in interfacegnu.trove.list.TDoubleList
-
binarySearch
public int binarySearch(double value) - Specified by:
binarySearch
in interfacegnu.trove.list.TDoubleList
-
binarySearch
public int binarySearch(double value, int fromIndex, int toIndex) - Specified by:
binarySearch
in interfacegnu.trove.list.TDoubleList
-
indexOf
public int indexOf(double value) - Specified by:
indexOf
in interfacegnu.trove.list.TDoubleList
-
indexOf
public int indexOf(int offset, double value) - Specified by:
indexOf
in interfacegnu.trove.list.TDoubleList
-
lastIndexOf
public int lastIndexOf(double value) - Specified by:
lastIndexOf
in interfacegnu.trove.list.TDoubleList
-
lastIndexOf
public int lastIndexOf(int offset, double value) - Specified by:
lastIndexOf
in interfacegnu.trove.list.TDoubleList
-
contains
public boolean contains(double value) - Specified by:
contains
in interfacegnu.trove.TDoubleCollection
- Specified by:
contains
in interfacegnu.trove.list.TDoubleList
-
iterator
public gnu.trove.iterator.TDoubleIterator iterator()- Specified by:
iterator
in interfacegnu.trove.TDoubleCollection
-
grep
public gnu.trove.list.TDoubleList grep(gnu.trove.procedure.TDoubleProcedure condition) - Specified by:
grep
in interfacegnu.trove.list.TDoubleList
-
inverseGrep
public gnu.trove.list.TDoubleList inverseGrep(gnu.trove.procedure.TDoubleProcedure condition) - Specified by:
inverseGrep
in interfacegnu.trove.list.TDoubleList
-
max
public double max()- Specified by:
max
in interfacegnu.trove.list.TDoubleList
-
min
public double min()- Specified by:
min
in interfacegnu.trove.list.TDoubleList
-
sum
public double sum()- Specified by:
sum
in interfacegnu.trove.list.TDoubleList
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
equals
-
hashCode
public int hashCode() -
toString
-