public class TSynchronizedIntList extends TSynchronizedIntCollection implements TIntList
| Constructor and Description |
|---|
TSynchronizedIntList(TIntList list) |
TSynchronizedIntList(TIntList list,
java.lang.Object mutex) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int[] vals)
Adds the values in the array vals to the end of the
list, in order.
|
void |
add(int[] 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(int value)
Performs a binary search for value in the entire list.
|
int |
binarySearch(int 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 val)
Fills every slot in the list with the specified value.
|
void |
fill(int fromIndex,
int toIndex,
int val)
Fills a range in the list with the specified value.
|
boolean |
forEachDescending(TIntProcedure procedure)
Applies the procedure to each value in the list in descending
(back to front) order.
|
int |
get(int index)
Returns the value at the specified offset.
|
TIntList |
grep(TIntProcedure 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 o)
Searches the list front to back for the index of
value.
|
int |
indexOf(int offset,
int value)
Searches the list front to back for the index of
value, starting at offset.
|
void |
insert(int offset,
int value)
Inserts value into the list at offset.
|
void |
insert(int offset,
int[] values)
Inserts the array of values into the list at
offset.
|
void |
insert(int offset,
int[] values,
int valOffset,
int len)
Inserts a slice of the array of values into the list
at offset.
|
TIntList |
inverseGrep(TIntProcedure condition)
Searches the list for values which do not satisfy
condition.
|
int |
lastIndexOf(int o)
Searches the list back to front for the last index of
value.
|
int |
lastIndexOf(int offset,
int value)
Searches the list back to front for the last index of
value, starting at offset.
|
int |
max()
Finds the maximum value in the list.
|
int |
min()
Finds the minimum value in the list.
|
void |
remove(int offset,
int length)
Removes length values from the list, starting at
offset
|
int |
removeAt(int offset)
Removes value at a given offset from the list.
|
int |
replace(int offset,
int 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.
|
int |
set(int index,
int element)
Sets the value at the specified offset.
|
void |
set(int offset,
int[] values)
Replace the values in the list starting at offset with
the contents of the values array.
|
void |
set(int offset,
int[] 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.
|
TIntList |
subList(int fromIndex,
int toIndex)
Returns a sublist of this list.
|
int |
sum()
Calculates the sum of all the values in the list.
|
int[] |
toArray(int[] dest,
int offset,
int len)
Copies a slice of the list into a native array.
|
int[] |
toArray(int[] dest,
int source_pos,
int dest_pos,
int len)
Copies a slice of the list into a native array.
|
int[] |
toArray(int offset,
int len)
Copies a slice of the list into a native array.
|
void |
transformValues(TIntFunction 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 TSynchronizedIntList(TIntList list)
public TSynchronizedIntList(TIntList list, java.lang.Object mutex)
public boolean equals(java.lang.Object o)
TIntCollectionequals in interface TIntCollectionequals in class java.lang.Objecto - object to be compared for equality with this collectionpublic int hashCode()
TIntCollectionObject.hashCode().hashCode in interface TIntCollectionhashCode in class java.lang.ObjectObject.equals(Object),
Collection.equals(Object)public int get(int index)
TIntListpublic int set(int index,
int element)
TIntListpublic void set(int offset,
int[] values)
TIntListpublic void set(int offset,
int[] values,
int valOffset,
int length)
TIntListpublic int replace(int offset,
int val)
TIntListpublic void remove(int offset,
int length)
TIntListpublic int removeAt(int offset)
TIntListpublic void add(int[] vals)
TIntListpublic void add(int[] vals,
int offset,
int length)
TIntListpublic void insert(int offset,
int value)
TIntListpublic void insert(int offset,
int[] values)
TIntListpublic void insert(int offset,
int[] values,
int valOffset,
int len)
TIntListpublic int indexOf(int o)
TIntListindexOf in interface TIntListo - an int valuefor faster searches on sorted listspublic int lastIndexOf(int o)
TIntListlastIndexOf in interface TIntListo - an int valuefor faster searches on sorted listspublic TIntList subList(int fromIndex, int toIndex)
TIntListpublic int[] toArray(int offset,
int len)
TIntListpublic int[] toArray(int[] dest,
int offset,
int len)
TIntListpublic int[] toArray(int[] dest,
int source_pos,
int dest_pos,
int len)
TIntListpublic int indexOf(int offset,
int value)
TIntListindexOf in interface TIntListoffset - the offset at which to start the linear search
(inclusive)value - an int valuefor faster searches on sorted listspublic int lastIndexOf(int offset,
int value)
TIntListlastIndexOf in interface TIntListoffset - the offset at which to start the linear search
(exclusive)value - an int valuefor faster searches on sorted listspublic void fill(int val)
TIntListpublic void fill(int fromIndex,
int toIndex,
int val)
TIntListpublic void reverse()
TIntListpublic void reverse(int from,
int to)
TIntListpublic void shuffle(java.util.Random rand)
TIntListpublic void sort()
TIntListpublic void sort(int fromIndex,
int toIndex)
TIntListpublic int binarySearch(int value)
TIntListbinarySearch in interface TIntListvalue - the value to search forpublic int binarySearch(int value,
int fromIndex,
int toIndex)
TIntListbinarySearch in interface TIntListvalue - the value to search forfromIndex - the lower boundary of the range (inclusive)toIndex - the upper boundary of the range (exclusive)public TIntList grep(TIntProcedure condition)
TIntListpublic TIntList inverseGrep(TIntProcedure condition)
TIntListgrep -v.inverseGrep in interface TIntListcondition - a condition to apply to each element in the listpublic int max()
TIntListpublic int min()
TIntListpublic int sum()
TIntListpublic boolean forEachDescending(TIntProcedure procedure)
TIntListforEachDescending in interface TIntListprocedure - a TIntProcedure valuepublic void transformValues(TIntFunction function)
TIntListtransformValues in interface TIntListfunction - a TIntFunction value