public class TSynchronizedByteList extends TSynchronizedByteCollection implements TByteList
| Constructor and Description |
|---|
TSynchronizedByteList(TByteList list) |
TSynchronizedByteList(TByteList list,
java.lang.Object mutex) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(byte[] vals)
Adds the values in the array vals to the end of the
list, in order.
|
void |
add(byte[] 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(byte value)
Performs a binary search for value in the entire list.
|
int |
binarySearch(byte 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(byte val)
Fills every slot in the list with the specified value.
|
void |
fill(int fromIndex,
int toIndex,
byte val)
Fills a range in the list with the specified value.
|
boolean |
forEachDescending(TByteProcedure procedure)
Applies the procedure to each value in the list in descending
(back to front) order.
|
byte |
get(int index)
Returns the value at the specified offset.
|
TByteList |
grep(TByteProcedure 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(byte o)
Searches the list front to back for the index of
value.
|
int |
indexOf(int offset,
byte value)
Searches the list front to back for the index of
value, starting at offset.
|
void |
insert(int offset,
byte value)
Inserts value into the list at offset.
|
void |
insert(int offset,
byte[] values)
Inserts the array of values into the list at
offset.
|
void |
insert(int offset,
byte[] values,
int valOffset,
int len)
Inserts a slice of the array of values into the list
at offset.
|
TByteList |
inverseGrep(TByteProcedure condition)
Searches the list for values which do not satisfy
condition.
|
int |
lastIndexOf(byte o)
Searches the list back to front for the last index of
value.
|
int |
lastIndexOf(int offset,
byte value)
Searches the list back to front for the last index of
value, starting at offset.
|
byte |
max()
Finds the maximum value in the list.
|
byte |
min()
Finds the minimum value in the list.
|
void |
remove(int offset,
int length)
Removes length values from the list, starting at
offset
|
byte |
removeAt(int offset)
Removes value at a given offset from the list.
|
byte |
replace(int offset,
byte 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.
|
byte |
set(int index,
byte element)
Sets the value at the specified offset.
|
void |
set(int offset,
byte[] values)
Replace the values in the list starting at offset with
the contents of the values array.
|
void |
set(int offset,
byte[] 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.
|
TByteList |
subList(int fromIndex,
int toIndex)
Returns a sublist of this list.
|
byte |
sum()
Calculates the sum of all the values in the list.
|
byte[] |
toArray(byte[] dest,
int offset,
int len)
Copies a slice of the list into a native array.
|
byte[] |
toArray(byte[] dest,
int source_pos,
int dest_pos,
int len)
Copies a slice of the list into a native array.
|
byte[] |
toArray(int offset,
int len)
Copies a slice of the list into a native array.
|
void |
transformValues(TByteFunction 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 TSynchronizedByteList(TByteList list)
public TSynchronizedByteList(TByteList list, java.lang.Object mutex)
public boolean equals(java.lang.Object o)
TByteCollectionequals in interface TByteCollectionequals in class java.lang.Objecto - object to be compared for equality with this collectionpublic int hashCode()
TByteCollectionObject.hashCode().hashCode in interface TByteCollectionhashCode in class java.lang.ObjectObject.equals(Object),
Collection.equals(Object)public byte get(int index)
TByteListpublic byte set(int index,
byte element)
TByteListpublic void set(int offset,
byte[] values)
TByteListpublic void set(int offset,
byte[] values,
int valOffset,
int length)
TByteListpublic byte replace(int offset,
byte val)
TByteListpublic void remove(int offset,
int length)
TByteListpublic byte removeAt(int offset)
TByteListpublic void add(byte[] vals)
TByteListpublic void add(byte[] vals,
int offset,
int length)
TByteListpublic void insert(int offset,
byte value)
TByteListpublic void insert(int offset,
byte[] values)
TByteListpublic void insert(int offset,
byte[] values,
int valOffset,
int len)
TByteListpublic int indexOf(byte o)
TByteListindexOf in interface TByteListo - an byte valuefor faster searches on sorted listspublic int lastIndexOf(byte o)
TByteListlastIndexOf in interface TByteListo - an byte valuefor faster searches on sorted listspublic TByteList subList(int fromIndex, int toIndex)
TByteListpublic byte[] toArray(int offset,
int len)
TByteListpublic byte[] toArray(byte[] dest,
int offset,
int len)
TByteListpublic byte[] toArray(byte[] dest,
int source_pos,
int dest_pos,
int len)
TByteListpublic int indexOf(int offset,
byte value)
TByteListindexOf in interface TByteListoffset - the offset at which to start the linear search
(inclusive)value - an byte valuefor faster searches on sorted listspublic int lastIndexOf(int offset,
byte value)
TByteListlastIndexOf in interface TByteListoffset - the offset at which to start the linear search
(exclusive)value - an byte valuefor faster searches on sorted listspublic void fill(byte val)
TByteListpublic void fill(int fromIndex,
int toIndex,
byte val)
TByteListpublic void reverse()
TByteListpublic void reverse(int from,
int to)
TByteListpublic void shuffle(java.util.Random rand)
TByteListpublic void sort()
TByteListpublic void sort(int fromIndex,
int toIndex)
TByteListpublic int binarySearch(byte value)
TByteListbinarySearch in interface TByteListvalue - the value to search forpublic int binarySearch(byte value,
int fromIndex,
int toIndex)
TByteListbinarySearch in interface TByteListvalue - the value to search forfromIndex - the lower boundary of the range (inclusive)toIndex - the upper boundary of the range (exclusive)public TByteList grep(TByteProcedure condition)
TByteListpublic TByteList inverseGrep(TByteProcedure condition)
TByteListgrep -v.inverseGrep in interface TByteListcondition - a condition to apply to each element in the listpublic byte max()
TByteListpublic byte min()
TByteListpublic byte sum()
TByteListpublic boolean forEachDescending(TByteProcedure procedure)
TByteListforEachDescending in interface TByteListprocedure - a TByteProcedure valuepublic void transformValues(TByteFunction function)
TByteListtransformValues in interface TByteListfunction - a TByteFunction value