public class TSynchronizedDoubleList extends TSynchronizedDoubleCollection implements TDoubleList
| Constructor and Description |
|---|
TSynchronizedDoubleList(TDoubleList list) |
TSynchronizedDoubleList(TDoubleList list,
java.lang.Object mutex) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(double[] vals)
Adds the values in the array vals to the end of the
list, in order.
|
void |
add(double[] vals,
int offset,
int length)
Adds a subset of the values in the array vals to the
end of the list, in order.
|
int |
binarySearch(double value)
Performs a binary search for value in the entire list.
|
int |
binarySearch(double value,
int fromIndex,
int toIndex)
Performs a binary search for value in the specified
range.
|
boolean |
equals(java.lang.Object o)
Compares the specified object with this collection for equality.
|
void |
fill(double val)
Fills every slot in the list with the specified value.
|
void |
fill(int fromIndex,
int toIndex,
double val)
Fills a range in the list with the specified value.
|
boolean |
forEachDescending(TDoubleProcedure procedure)
Applies the procedure to each value in the list in descending
(back to front) order.
|
double |
get(int index)
Returns the value at the specified offset.
|
TDoubleList |
grep(TDoubleProcedure condition)
Searches the list for values satisfying condition in
the manner of the *nix grep utility.
|
int |
hashCode()
Returns the hash code value for this collection.
|
int |
indexOf(double o)
Searches the list front to back for the index of
value.
|
int |
indexOf(int offset,
double value)
Searches the list front to back for the index of
value, starting at offset.
|
void |
insert(int offset,
double value)
Inserts value into the list at offset.
|
void |
insert(int offset,
double[] values)
Inserts the array of values into the list at
offset.
|
void |
insert(int offset,
double[] values,
int valOffset,
int len)
Inserts a slice of the array of values into the list
at offset.
|
TDoubleList |
inverseGrep(TDoubleProcedure condition)
Searches the list for values which do not satisfy
condition.
|
int |
lastIndexOf(double o)
Searches the list back to front for the last index of
value.
|
int |
lastIndexOf(int offset,
double value)
Searches the list back to front for the last index of
value, starting at offset.
|
double |
max()
Finds the maximum value in the list.
|
double |
min()
Finds the minimum value in the list.
|
void |
remove(int offset,
int length)
Removes length values from the list, starting at
offset
|
double |
removeAt(int offset)
Removes value at a given offset from the list.
|
double |
replace(int offset,
double val)
Sets the value at the specified offset and returns the
previously stored value.
|
void |
reverse()
Reverse the order of the elements in the list.
|
void |
reverse(int from,
int to)
Reverse the order of the elements in the range of the list.
|
double |
set(int index,
double element)
Sets the value at the specified offset.
|
void |
set(int offset,
double[] values)
Replace the values in the list starting at offset with
the contents of the values array.
|
void |
set(int offset,
double[] values,
int valOffset,
int length)
Replace the values in the list starting at offset with
length values from the values array, starting
at valOffset.
|
void |
shuffle(java.util.Random rand)
Shuffle the elements of the list using the specified random
number generator.
|
void |
sort()
Sort the values in the list (ascending) using the Sun quicksort
implementation.
|
void |
sort(int fromIndex,
int toIndex)
Sort a slice of the list (ascending) using the Sun quicksort
implementation.
|
TDoubleList |
subList(int fromIndex,
int toIndex)
Returns a sublist of this list.
|
double |
sum()
Calculates the sum of all the values in the list.
|
double[] |
toArray(double[] dest,
int offset,
int len)
Copies a slice of the list into a native array.
|
double[] |
toArray(double[] dest,
int source_pos,
int dest_pos,
int len)
Copies a slice of the list into a native array.
|
double[] |
toArray(int offset,
int len)
Copies a slice of the list into a native array.
|
void |
transformValues(TDoubleFunction function)
Transform each value in the list using the specified function.
|
add, addAll, addAll, addAll, clear, contains, containsAll, containsAll, containsAll, forEach, getNoEntryValue, isEmpty, iterator, remove, removeAll, removeAll, removeAll, retainAll, retainAll, retainAll, size, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, clear, contains, forEach, getNoEntryValue, isEmpty, remove, size, toArray, toArrayaddAll, addAll, addAll, containsAll, containsAll, containsAll, iterator, removeAll, removeAll, removeAll, retainAll, retainAll, retainAllpublic TSynchronizedDoubleList(TDoubleList list)
public TSynchronizedDoubleList(TDoubleList list, java.lang.Object mutex)
public boolean equals(java.lang.Object o)
TDoubleCollectionequals in interface TDoubleCollectionequals in class java.lang.Objecto - object to be compared for equality with this collectionpublic int hashCode()
TDoubleCollectionObject.hashCode().hashCode in interface TDoubleCollectionhashCode in class java.lang.ObjectObject.equals(Object),
Collection.equals(Object)public double get(int index)
TDoubleListget in interface TDoubleListindex - an int valuedouble valuepublic double set(int index,
double element)
TDoubleListset in interface TDoubleListindex - an int valueelement - an double valuepublic void set(int offset,
double[] values)
TDoubleListset in interface TDoubleListoffset - the first offset to replacevalues - the source of the new valuespublic void set(int offset,
double[] values,
int valOffset,
int length)
TDoubleListset in interface TDoubleListoffset - the first offset to replacevalues - the source of the new valuesvalOffset - the first value to copy from the values arraylength - the number of values to copypublic double replace(int offset,
double val)
TDoubleListreplace in interface TDoubleListoffset - an int valueval - an double valuepublic void remove(int offset,
int length)
TDoubleListremove in interface TDoubleListoffset - an int valuelength - an int valuepublic double removeAt(int offset)
TDoubleListremoveAt in interface TDoubleListoffset - an int value that represents
the offset to the element to be removedpublic void add(double[] vals)
TDoubleListadd in interface TDoubleListvals - an double[] valuepublic void add(double[] vals,
int offset,
int length)
TDoubleListadd in interface TDoubleListvals - an double[] valueoffset - the offset at which to start copyinglength - the number of values to copy.public void insert(int offset,
double value)
TDoubleListinsert in interface TDoubleListoffset - an int valuevalue - an double valuepublic void insert(int offset,
double[] values)
TDoubleListinsert in interface TDoubleListoffset - an int valuevalues - an double[] valuepublic void insert(int offset,
double[] values,
int valOffset,
int len)
TDoubleListinsert in interface TDoubleListoffset - an int valuevalues - an double[] valuevalOffset - the offset in the values array at which to
start copying.len - the number of values to copy from the values arraypublic int indexOf(double o)
TDoubleListindexOf in interface TDoubleListo - an double valuefor faster searches on sorted listspublic int lastIndexOf(double o)
TDoubleListlastIndexOf in interface TDoubleListo - an double valuefor faster searches on sorted listspublic TDoubleList subList(int fromIndex, int toIndex)
TDoubleListsubList in interface TDoubleListfromIndex - low endpoint (inclusive) of the subList.toIndex - high endpoint (exclusive) of the subList.public double[] toArray(int offset,
int len)
TDoubleListtoArray in interface TDoubleListoffset - the offset at which to start copyinglen - the number of values to copy.double[] valuepublic double[] toArray(double[] dest,
int offset,
int len)
TDoubleListtoArray in interface TDoubleListdest - the array to copy into.offset - the offset where the first value should be copiedlen - the number of values to copy.public double[] toArray(double[] dest,
int source_pos,
int dest_pos,
int len)
TDoubleListtoArray in interface TDoubleListdest - the array to copy into.source_pos - the offset of the first value to copydest_pos - the offset where the first value should be copiedlen - the number of values to copy.public int indexOf(int offset,
double value)
TDoubleListindexOf in interface TDoubleListoffset - the offset at which to start the linear search
(inclusive)value - an double valuefor faster searches on sorted listspublic int lastIndexOf(int offset,
double value)
TDoubleListlastIndexOf in interface TDoubleListoffset - the offset at which to start the linear search
(exclusive)value - an double valuefor faster searches on sorted listspublic void fill(double val)
TDoubleListfill in interface TDoubleListval - the value to use when fillingpublic void fill(int fromIndex,
int toIndex,
double val)
TDoubleListfill in interface TDoubleListfromIndex - the offset at which to start filling (inclusive)toIndex - the offset at which to stop filling (exclusive)val - the value to use when fillingpublic void reverse()
TDoubleListreverse in interface TDoubleListpublic void reverse(int from,
int to)
TDoubleListreverse in interface TDoubleListfrom - the inclusive index at which to start reversingto - the exclusive index at which to stop reversingpublic void shuffle(java.util.Random rand)
TDoubleListshuffle in interface TDoubleListrand - a Random valuepublic void sort()
TDoubleListsort in interface TDoubleListArrays.sort(int[])public void sort(int fromIndex,
int toIndex)
TDoubleListsort in interface TDoubleListfromIndex - the index at which to start sorting (inclusive)toIndex - the index at which to stop sorting (exclusive)Arrays.sort(int[])public int binarySearch(double value)
TDoubleListbinarySearch in interface TDoubleListvalue - the value to search forpublic int binarySearch(double value,
int fromIndex,
int toIndex)
TDoubleListbinarySearch in interface TDoubleListvalue - the value to search forfromIndex - the lower boundary of the range (inclusive)toIndex - the upper boundary of the range (exclusive)public TDoubleList grep(TDoubleProcedure condition)
TDoubleListgrep in interface TDoubleListcondition - a condition to apply to each element in the listpublic TDoubleList inverseGrep(TDoubleProcedure condition)
TDoubleListgrep -v.inverseGrep in interface TDoubleListcondition - a condition to apply to each element in the listpublic double max()
TDoubleListmax in interface TDoubleListpublic double min()
TDoubleListmin in interface TDoubleListpublic double sum()
TDoubleListsum in interface TDoubleListpublic boolean forEachDescending(TDoubleProcedure procedure)
TDoubleListforEachDescending in interface TDoubleListprocedure - a TDoubleProcedure valuepublic void transformValues(TDoubleFunction function)
TDoubleListtransformValues in interface TDoubleListfunction - a TDoubleFunction value