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