Package gnu.trove.impl.unmodifiable
Class TUnmodifiableByteList
java.lang.Object
gnu.trove.impl.unmodifiable.TUnmodifiableByteCollection
gnu.trove.impl.unmodifiable.TUnmodifiableByteList
- All Implemented Interfaces:
TByteList,TByteCollection,Serializable
- Direct Known Subclasses:
TUnmodifiableRandomAccessByteList
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(byte[] vals) Adds the values in the array vals to the end of the list, in order.voidadd(byte[] vals, int offset, int length) Adds a subset of the values in the array vals to the end of the list, in order.intbinarySearch(byte value) Performs a binary search for value in the entire list.intbinarySearch(byte value, int fromIndex, int toIndex) Performs a binary search for value in the specified range.booleanCompares the specified object with this collection for equality.voidfill(byte val) Fills every slot in the list with the specified value.voidfill(int fromIndex, int toIndex, byte val) Fills a range in the list with the specified value.booleanforEachDescending(TByteProcedure procedure) Applies the procedure to each value in the list in descending (back to front) order.byteget(int index) Returns the value at the specified offset.grep(TByteProcedure condition) Searches the list for values satisfying condition in the manner of the *nix grep utility.inthashCode()Returns the hash code value for this collection.intindexOf(byte o) Searches the list front to back for the index of value.intindexOf(int offset, byte value) Searches the list front to back for the index of value, starting at offset.voidinsert(int offset, byte value) Inserts value into the list at offset.voidinsert(int offset, byte[] values) Inserts the array of values into the list at offset.voidinsert(int offset, byte[] values, int valOffset, int len) Inserts a slice of the array of values into the list at offset.inverseGrep(TByteProcedure condition) Searches the list for values which do not satisfy condition.intlastIndexOf(byte o) Searches the list back to front for the last index of value.intlastIndexOf(int offset, byte value) Searches the list back to front for the last index of value, starting at offset.bytemax()Finds the maximum value in the list.bytemin()Finds the minimum value in the list.voidremove(int offset, int length) Removes length values from the list, starting at offsetbyteremoveAt(int offset) Removes value at a given offset from the list.bytereplace(int offset, byte val) Sets the value at the specified offset and returns the previously stored value.voidreverse()Reverse the order of the elements in the list.voidreverse(int from, int to) Reverse the order of the elements in the range of the list.byteset(int offset, byte val) Sets the value at the specified offset.voidset(int offset, byte[] values) Replace the values in the list starting at offset with the contents of the values array.voidset(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.voidShuffle the elements of the list using the specified random number generator.voidsort()Sort the values in the list (ascending) using the Sun quicksort implementation.voidsort(int fromIndex, int toIndex) Sort a slice of the list (ascending) using the Sun quicksort implementation.subList(int fromIndex, int toIndex) Returns a sublist of this list.bytesum()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.voidtransformValues(TByteFunction function) Transform each value in the list using the specified function.Methods inherited from class gnu.trove.impl.unmodifiable.TUnmodifiableByteCollection
add, addAll, addAll, addAll, clear, contains, containsAll, containsAll, containsAll, forEach, getNoEntryValue, isEmpty, iterator, remove, removeAll, removeAll, removeAll, retainAll, retainAll, retainAll, size, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface gnu.trove.TByteCollection
addAll, addAll, addAll, containsAll, containsAll, containsAll, iterator, removeAll, removeAll, removeAll, retainAll, retainAll, retainAll
-
Constructor Details
-
TUnmodifiableByteList
-
-
Method Details
-
equals
Description copied from interface:TByteCollectionCompares the specified object with this collection for equality. Returns true if the specified object is also a collection, the two collection have the same size, and every member of the specified collection is contained in this collection (or equivalently, every member of this collection is contained in the specified collection). This definition ensures that the equals method works properly across different implementations of the collection interface.- Specified by:
equalsin interfaceTByteCollection- Overrides:
equalsin classObject- Parameters:
o- object to be compared for equality with this collection- Returns:
- true if the specified object is equal to this collection
-
hashCode
public int hashCode()Description copied from interface:TByteCollectionReturns the hash code value for this collection. The hash code of a collection is defined to be the sum of the hash codes of the elements in the collection. This ensures that s1.equals(s2) implies that s1.hashCode()==s2.hashCode() for any two collection s1 and s2, as required by the general contract ofObject.hashCode().- Specified by:
hashCodein interfaceTByteCollection- Overrides:
hashCodein classObject- Returns:
- the hash code value for this collection
- See Also:
-
get
public byte get(int index) Description copied from interface:TByteListReturns the value at the specified offset. -
indexOf
public int indexOf(byte o) Description copied from interface:TByteListSearches the list front to back for the index of value. -
lastIndexOf
public int lastIndexOf(byte o) Description copied from interface:TByteListSearches the list back to front for the last index of value.- Specified by:
lastIndexOfin interfaceTByteList- Parameters:
o- anbytevalue- Returns:
- the last offset of the value, or -1 if it is not in the list.
- See Also:
-
toArray
public byte[] toArray(int offset, int len) Description copied from interface:TByteListCopies a slice of the list into a native array. -
toArray
public byte[] toArray(byte[] dest, int offset, int len) Description copied from interface:TByteListCopies a slice of the list into a native array. -
toArray
public byte[] toArray(byte[] dest, int source_pos, int dest_pos, int len) Description copied from interface:TByteListCopies a slice of the list into a native array. -
forEachDescending
Description copied from interface:TByteListApplies the procedure to each value in the list in descending (back to front) order.- Specified by:
forEachDescendingin interfaceTByteList- Parameters:
procedure- aTByteProcedurevalue- Returns:
- true if the procedure did not terminate prematurely.
-
binarySearch
public int binarySearch(byte value) Description copied from interface:TByteListPerforms a binary search for value in the entire list. Note that you must @{link #sort sort} the list before doing a search.- Specified by:
binarySearchin interfaceTByteList- Parameters:
value- the value to search for- Returns:
- the absolute offset in the list of the value, or its negative insertion point into the sorted list.
-
binarySearch
public int binarySearch(byte value, int fromIndex, int toIndex) Description copied from interface:TByteListPerforms a binary search for value in the specified range. Note that you must @{link #sort sort} the list or the range before doing a search.- Specified by:
binarySearchin interfaceTByteList- Parameters:
value- the value to search forfromIndex- the lower boundary of the range (inclusive)toIndex- the upper boundary of the range (exclusive)- Returns:
- the absolute offset in the list of the value, or its negative insertion point into the sorted list.
-
indexOf
public int indexOf(int offset, byte value) Description copied from interface:TByteListSearches the list front to back for the index of value, starting at offset. -
lastIndexOf
public int lastIndexOf(int offset, byte value) Description copied from interface:TByteListSearches the list back to front for the last index of value, starting at offset.- Specified by:
lastIndexOfin interfaceTByteList- Parameters:
offset- the offset at which to start the linear search (exclusive)value- anbytevalue- Returns:
- the last offset of the value, or -1 if it is not in the list.
- See Also:
-
grep
Description copied from interface:TByteListSearches the list for values satisfying condition in the manner of the *nix grep utility. -
inverseGrep
Description copied from interface:TByteListSearches the list for values which do not satisfy condition. This is akin to *nixgrep -v.- Specified by:
inverseGrepin interfaceTByteList- Parameters:
condition- a condition to apply to each element in the list- Returns:
- a list of values which do not match the condition.
-
max
public byte max()Description copied from interface:TByteListFinds the maximum value in the list. -
min
public byte min()Description copied from interface:TByteListFinds the minimum value in the list. -
sum
public byte sum()Description copied from interface:TByteListCalculates the sum of all the values in the list. -
subList
Description copied from interface:TByteListReturns a sublist of this list. -
add
public void add(byte[] vals) Description copied from interface:TByteListAdds the values in the array vals to the end of the list, in order. -
add
public void add(byte[] vals, int offset, int length) Description copied from interface:TByteListAdds a subset of the values in the array vals to the end of the list, in order. -
removeAt
public byte removeAt(int offset) Description copied from interface:TByteListRemoves value at a given offset from the list. -
remove
public void remove(int offset, int length) Description copied from interface:TByteListRemoves length values from the list, starting at offset -
insert
public void insert(int offset, byte value) Description copied from interface:TByteListInserts value into the list at offset. All values including and to the right of offset are shifted to the right. -
insert
public void insert(int offset, byte[] values) Description copied from interface:TByteListInserts the array of values into the list at offset. All values including and to the right of offset are shifted to the right. -
insert
public void insert(int offset, byte[] values, int valOffset, int len) Description copied from interface:TByteListInserts a slice of the array of values into the list at offset. All values including and to the right of offset are shifted to the right. -
set
public byte set(int offset, byte val) Description copied from interface:TByteListSets the value at the specified offset. -
set
public void set(int offset, byte[] values) Description copied from interface:TByteListReplace the values in the list starting at offset with the contents of the values array. -
set
public void set(int offset, byte[] values, int valOffset, int length) Description copied from interface:TByteListReplace the values in the list starting at offset with length values from the values array, starting at valOffset. -
replace
public byte replace(int offset, byte val) Description copied from interface:TByteListSets the value at the specified offset and returns the previously stored value. -
transformValues
Description copied from interface:TByteListTransform each value in the list using the specified function.- Specified by:
transformValuesin interfaceTByteList- Parameters:
function- aTByteFunctionvalue
-
reverse
public void reverse()Description copied from interface:TByteListReverse the order of the elements in the list. -
reverse
public void reverse(int from, int to) Description copied from interface:TByteListReverse the order of the elements in the range of the list. -
shuffle
Description copied from interface:TByteListShuffle the elements of the list using the specified random number generator. -
sort
public void sort()Description copied from interface:TByteListSort the values in the list (ascending) using the Sun quicksort implementation. -
sort
public void sort(int fromIndex, int toIndex) Description copied from interface:TByteListSort a slice of the list (ascending) using the Sun quicksort implementation. -
fill
public void fill(byte val) Description copied from interface:TByteListFills every slot in the list with the specified value. -
fill
public void fill(int fromIndex, int toIndex, byte val) Description copied from interface:TByteListFills a range in the list with the specified value.
-