public class TSynchronizedIntList extends TSynchronizedIntCollectionimplements TIntList
| Constructor and Description |
|---|
TSynchronizedIntList(TIntList
|
TSynchronizedIntList(TIntList
|
| 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(Object
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
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
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
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(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.
|
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
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(TIntListlist)
public boolean equals(Objecto)
TIntCollection
equals in interface
TIntCollection
equals in class
Object
o - object to be compared for equality with this collection
public int hashCode()
TIntCollection
Object.hashCode() .
hashCode in interface
TIntCollection
hashCode in class
Object
Object.equals(Object) ,
Collection.equals(Object)
public int get(int index)
TIntList
public int set(int index,
int element)
TIntList
public void set(int offset,
int[] values)
TIntList
public void set(int offset,
int[] values,
int valOffset,
int length)
TIntList
public int replace(int offset,
int val)
TIntList
public void remove(int offset,
int length)
TIntList
public int removeAt(int offset)
TIntList
public void add(int[] vals)
TIntList
public void add(int[] vals,
int offset,
int length)
TIntList
public void insert(int offset,
int value)
TIntList
public void insert(int offset,
int[] values)
TIntList
public void insert(int offset,
int[] values,
int valOffset,
int len)
TIntList
public int indexOf(int o)
TIntList
indexOf in interface
TIntList
o - an
int value
for faster searches on sorted lists
public int lastIndexOf(int o)
TIntList
lastIndexOf in interface
TIntList
o - an
int value
for faster searches on sorted lists
public TIntListsubList(int fromIndex, int toIndex)
TIntList
public int[] toArray(int offset,
int len)
TIntList
public int[] toArray(int[] dest,
int offset,
int len)
TIntList
public int[] toArray(int[] dest,
int source_pos,
int dest_pos,
int len)
TIntList
public int indexOf(int offset,
int value)
TIntList
indexOf in interface
TIntList
offset - the offset at which to start the linear search (inclusive)
value - an
int value
for faster searches on sorted lists
public int lastIndexOf(int offset,
int value)
TIntList
lastIndexOf in interface
TIntList
offset - the offset at which to start the linear search (exclusive)
value - an
int value
for faster searches on sorted lists
public void fill(int val)
TIntList
public void fill(int fromIndex,
int toIndex,
int val)
TIntList
public void reverse()
TIntList
public void reverse(int from,
int to)
TIntList
public void shuffle(Randomrand)
TIntList
public void sort()
TIntList
sort in interface
TIntList
Arrays.sort(int[])
public void sort(int fromIndex,
int toIndex)
TIntList
sort in interface
TIntList
fromIndex - the index at which to start sorting (inclusive)
toIndex - the index at which to stop sorting (exclusive)
Arrays.sort(int[])
public int binarySearch(int value)
TIntList
binarySearch in interface
TIntList
value - the value to search for
public int binarySearch(int value,
int fromIndex,
int toIndex)
TIntList
binarySearch in interface
TIntList
value - the value to search for
fromIndex - the lower boundary of the range (inclusive)
toIndex - the upper boundary of the range (exclusive)
public TIntListgrep(TIntProcedure condition)
TIntList
public TIntListinverseGrep(TIntProcedure condition)
TIntList
grep -v.
inverseGrep in interface
TIntList
condition - a condition to apply to each element in the list
public int max()
TIntList
public int min()
TIntList
public int sum()
TIntList
public boolean forEachDescending(TIntProcedureprocedure)
TIntList
forEachDescending in interface
TIntList
procedure - a
TIntProcedure value
public void transformValues(TIntFunctionfunction)
TIntList
transformValues in interface
TIntList
function - a
TIntFunction value