public class TSynchronizedDoubleList extends TSynchronizedDoubleCollectionimplements TDoubleList
| Constructor and Description |
|---|
TSynchronizedDoubleList(TDoubleList
|
TSynchronizedDoubleList(TDoubleList
|
| 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(Object
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
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
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
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(Random
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
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(TDoubleListlist)
public TSynchronizedDoubleList(TDoubleListlist, Object mutex)
public boolean equals(Objecto)
TDoubleCollection
equals in interface
TDoubleCollection
equals in class
Object
o - object to be compared for equality with this collection
public int hashCode()
TDoubleCollection
Object.hashCode() .
hashCode in interface
TDoubleCollection
hashCode in class
Object
Object.equals(Object) ,
Collection.equals(Object)
public double get(int index)
TDoubleList
get in interface
TDoubleList
index - an
int value
double value
public double set(int index,
double element)
TDoubleList
set in interface
TDoubleList
index - an
int value
element - an
double value
public void set(int offset,
double[] values)
TDoubleList
set in interface
TDoubleList
offset - the first offset to replace
values - the source of the new values
public void set(int offset,
double[] values,
int valOffset,
int length)
TDoubleList
set in interface
TDoubleList
offset - the first offset to replace
values - the source of the new values
valOffset - the first value to copy from the values array
length - the number of values to copy
public double replace(int offset,
double val)
TDoubleList
replace in interface
TDoubleList
offset - an
int value
val - an
double value
public void remove(int offset,
int length)
TDoubleList
remove in interface
TDoubleList
offset - an
int value
length - an
int value
public double removeAt(int offset)
TDoubleList
removeAt in interface
TDoubleList
offset - an
int value that represents the offset to the element to be removed
public void add(double[] vals)
TDoubleList
add in interface
TDoubleList
vals - an
double[] value
public void add(double[] vals,
int offset,
int length)
TDoubleList
add in interface
TDoubleList
vals - an
double[] value
offset - the offset at which to start copying
length - the number of values to copy.
public void insert(int offset,
double value)
TDoubleList
insert in interface
TDoubleList
offset - an
int value
value - an
double value
public void insert(int offset,
double[] values)
TDoubleList
insert in interface
TDoubleList
offset - an
int value
values - an
double[] value
public void insert(int offset,
double[] values,
int valOffset,
int len)
TDoubleList
insert in interface
TDoubleList
offset - an
int value
values - an
double[] value
valOffset - the offset in the values array at which to start copying.
len - the number of values to copy from the values array
public int indexOf(double o)
TDoubleList
indexOf in interface
TDoubleList
o - an
double value
for faster searches on sorted lists
public int lastIndexOf(double o)
TDoubleList
lastIndexOf in interface
TDoubleList
o - an
double value
for faster searches on sorted lists
public TDoubleListsubList(int fromIndex, int toIndex)
TDoubleList
subList in interface
TDoubleList
fromIndex - low endpoint (inclusive) of the subList.
toIndex - high endpoint (exclusive) of the subList.
public double[] toArray(int offset,
int len)
TDoubleList
toArray in interface
TDoubleList
offset - the offset at which to start copying
len - the number of values to copy.
double[] value
public double[] toArray(double[] dest,
int offset,
int len)
TDoubleList
toArray in interface
TDoubleList
dest - the array to copy into.
offset - the offset where the first value should be copied
len - the number of values to copy.
public double[] toArray(double[] dest,
int source_pos,
int dest_pos,
int len)
TDoubleList
toArray in interface
TDoubleList
dest - the array to copy into.
source_pos - the offset of the first value to copy
dest_pos - the offset where the first value should be copied
len - the number of values to copy.
public int indexOf(int offset,
double value)
TDoubleList
indexOf in interface
TDoubleList
offset - the offset at which to start the linear search (inclusive)
value - an
double value
for faster searches on sorted lists
public int lastIndexOf(int offset,
double value)
TDoubleList
lastIndexOf in interface
TDoubleList
offset - the offset at which to start the linear search (exclusive)
value - an
double value
for faster searches on sorted lists
public void fill(double val)
TDoubleList
fill in interface
TDoubleList
val - the value to use when filling
public void fill(int fromIndex,
int toIndex,
double val)
TDoubleList
fill in interface
TDoubleList
fromIndex - the offset at which to start filling (inclusive)
toIndex - the offset at which to stop filling (exclusive)
val - the value to use when filling
public void reverse()
TDoubleList
public void reverse(int from,
int to)
TDoubleList
reverse in interface
TDoubleList
from - the inclusive index at which to start reversing
to - the exclusive index at which to stop reversing
public void shuffle(Randomrand)
TDoubleList
shuffle in interface
TDoubleList
rand - a
Random value
public void sort()
TDoubleList
sort in interface
TDoubleList
Arrays.sort(int[])
public void sort(int fromIndex,
int toIndex)
TDoubleList
sort in interface
TDoubleList
fromIndex - 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)
TDoubleList
binarySearch in interface
TDoubleList
value - the value to search for
public int binarySearch(double value,
int fromIndex,
int toIndex)
TDoubleList
binarySearch in interface
TDoubleList
value - the value to search for
fromIndex - the lower boundary of the range (inclusive)
toIndex - the upper boundary of the range (exclusive)
public TDoubleListgrep(TDoubleProcedure condition)
TDoubleList
grep in interface
TDoubleList
condition - a condition to apply to each element in the list
public TDoubleListinverseGrep(TDoubleProcedure condition)
TDoubleList
grep -v.
inverseGrep in interface
TDoubleList
condition - a condition to apply to each element in the list
public double max()
TDoubleList
max in interface
TDoubleList
public double min()
TDoubleList
min in interface
TDoubleList
public double sum()
TDoubleList
sum in interface
TDoubleList
public boolean forEachDescending(TDoubleProcedureprocedure)
TDoubleList
forEachDescending in interface
TDoubleList
procedure - a
TDoubleProcedure value
public void transformValues(TDoubleFunctionfunction)
TDoubleList
transformValues in interface
TDoubleList
function - a
TDoubleFunction value