public class TSynchronizedShortList extends TSynchronizedShortCollection implements TShortList
| Constructor and Description |
|---|
TSynchronizedShortList(TShortList list) |
TSynchronizedShortList(TShortList list,
java.lang.Object mutex) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(short[] vals)
Adds the values in the array vals to the end of the
list, in order.
|
void |
add(short[] 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(short value)
Performs a binary search for value in the entire list.
|
int |
binarySearch(short 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(int fromIndex,
int toIndex,
short val)
Fills a range in the list with the specified value.
|
void |
fill(short val)
Fills every slot in the list with the specified value.
|
boolean |
forEachDescending(TShortProcedure procedure)
Applies the procedure to each value in the list in descending
(back to front) order.
|
short |
get(int index)
Returns the value at the specified offset.
|
TShortList |
grep(TShortProcedure 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(int offset,
short value)
Searches the list front to back for the index of
value, starting at offset.
|
int |
indexOf(short o)
Searches the list front to back for the index of
value.
|
void |
insert(int offset,
short value)
Inserts value into the list at offset.
|
void |
insert(int offset,
short[] values)
Inserts the array of values into the list at
offset.
|
void |
insert(int offset,
short[] values,
int valOffset,
int len)
Inserts a slice of the array of values into the list
at offset.
|
TShortList |
inverseGrep(TShortProcedure condition)
Searches the list for values which do not satisfy
condition.
|
int |
lastIndexOf(int offset,
short value)
Searches the list back to front for the last index of
value, starting at offset.
|
int |
lastIndexOf(short o)
Searches the list back to front for the last index of
value.
|
short |
max()
Finds the maximum value in the list.
|
short |
min()
Finds the minimum value in the list.
|
void |
remove(int offset,
int length)
Removes length values from the list, starting at
offset
|
short |
removeAt(int offset)
Removes value at a given offset from the list.
|
short |
replace(int offset,
short 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.
|
short |
set(int index,
short element)
Sets the value at the specified offset.
|
void |
set(int offset,
short[] values)
Replace the values in the list starting at offset with
the contents of the values array.
|
void |
set(int offset,
short[] 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.
|
TShortList |
subList(int fromIndex,
int toIndex)
Returns a sublist of this list.
|
short |
sum()
Calculates the sum of all the values in the list.
|
short[] |
toArray(int offset,
int len)
Copies a slice of the list into a native array.
|
short[] |
toArray(short[] dest,
int offset,
int len)
Copies a slice of the list into a native array.
|
short[] |
toArray(short[] dest,
int source_pos,
int dest_pos,
int len)
Copies a slice of the list into a native array.
|
void |
transformValues(TShortFunction 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 TSynchronizedShortList(TShortList list)
public TSynchronizedShortList(TShortList list, java.lang.Object mutex)
public boolean equals(java.lang.Object o)
TShortCollectionequals in interface TShortCollectionequals in class java.lang.Objecto - object to be compared for equality with this collectionpublic int hashCode()
TShortCollectionObject.hashCode().hashCode in interface TShortCollectionhashCode in class java.lang.ObjectObject.equals(Object),
Collection.equals(Object)public short get(int index)
TShortListget in interface TShortListindex - an int valueshort valuepublic short set(int index,
short element)
TShortListset in interface TShortListindex - an int valueelement - an short valuepublic void set(int offset,
short[] values)
TShortListset in interface TShortListoffset - the first offset to replacevalues - the source of the new valuespublic void set(int offset,
short[] values,
int valOffset,
int length)
TShortListset in interface TShortListoffset - 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 short replace(int offset,
short val)
TShortListreplace in interface TShortListoffset - an int valueval - an short valuepublic void remove(int offset,
int length)
TShortListremove in interface TShortListoffset - an int valuelength - an int valuepublic short removeAt(int offset)
TShortListremoveAt in interface TShortListoffset - an int value that represents
the offset to the element to be removedpublic void add(short[] vals)
TShortListadd in interface TShortListvals - an short[] valuepublic void add(short[] vals,
int offset,
int length)
TShortListadd in interface TShortListvals - an short[] valueoffset - the offset at which to start copyinglength - the number of values to copy.public void insert(int offset,
short value)
TShortListinsert in interface TShortListoffset - an int valuevalue - an short valuepublic void insert(int offset,
short[] values)
TShortListinsert in interface TShortListoffset - an int valuevalues - an short[] valuepublic void insert(int offset,
short[] values,
int valOffset,
int len)
TShortListinsert in interface TShortListoffset - an int valuevalues - an short[] 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(short o)
TShortListindexOf in interface TShortListo - an short valuefor faster searches on sorted listspublic int lastIndexOf(short o)
TShortListlastIndexOf in interface TShortListo - an short valuefor faster searches on sorted listspublic TShortList subList(int fromIndex, int toIndex)
TShortListsubList in interface TShortListfromIndex - low endpoint (inclusive) of the subList.toIndex - high endpoint (exclusive) of the subList.public short[] toArray(int offset,
int len)
TShortListtoArray in interface TShortListoffset - the offset at which to start copyinglen - the number of values to copy.short[] valuepublic short[] toArray(short[] dest,
int offset,
int len)
TShortListtoArray in interface TShortListdest - the array to copy into.offset - the offset where the first value should be copiedlen - the number of values to copy.public short[] toArray(short[] dest,
int source_pos,
int dest_pos,
int len)
TShortListtoArray in interface TShortListdest - 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,
short value)
TShortListindexOf in interface TShortListoffset - the offset at which to start the linear search
(inclusive)value - an short valuefor faster searches on sorted listspublic int lastIndexOf(int offset,
short value)
TShortListlastIndexOf in interface TShortListoffset - the offset at which to start the linear search
(exclusive)value - an short valuefor faster searches on sorted listspublic void fill(short val)
TShortListfill in interface TShortListval - the value to use when fillingpublic void fill(int fromIndex,
int toIndex,
short val)
TShortListfill in interface TShortListfromIndex - 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()
TShortListreverse in interface TShortListpublic void reverse(int from,
int to)
TShortListreverse in interface TShortListfrom - the inclusive index at which to start reversingto - the exclusive index at which to stop reversingpublic void shuffle(java.util.Random rand)
TShortListshuffle in interface TShortListrand - a Random valuepublic void sort()
TShortListsort in interface TShortListArrays.sort(int[])public void sort(int fromIndex,
int toIndex)
TShortListsort in interface TShortListfromIndex - the index at which to start sorting (inclusive)toIndex - the index at which to stop sorting (exclusive)Arrays.sort(int[])public int binarySearch(short value)
TShortListbinarySearch in interface TShortListvalue - the value to search forpublic int binarySearch(short value,
int fromIndex,
int toIndex)
TShortListbinarySearch in interface TShortListvalue - the value to search forfromIndex - the lower boundary of the range (inclusive)toIndex - the upper boundary of the range (exclusive)public TShortList grep(TShortProcedure condition)
TShortListgrep in interface TShortListcondition - a condition to apply to each element in the listpublic TShortList inverseGrep(TShortProcedure condition)
TShortListgrep -v.inverseGrep in interface TShortListcondition - a condition to apply to each element in the listpublic short max()
TShortListmax in interface TShortListpublic short min()
TShortListmin in interface TShortListpublic short sum()
TShortListsum in interface TShortListpublic boolean forEachDescending(TShortProcedure procedure)
TShortListforEachDescending in interface TShortListprocedure - a TShortProcedure valuepublic void transformValues(TShortFunction function)
TShortListtransformValues in interface TShortListfunction - a TShortFunction value