public interface ILcdByteList extends List<Byte>, ILcdCloneable
List
interface that is optimized for bytes.
It provides extra methods using byte primitives, instead of Byte
objects.Modifier and Type | Method and Description |
---|---|
default boolean |
addAll(byte[] aValues)
Equivalent to
addAll(size(), aValues, 0, aValues.length . |
default boolean |
addAll(byte[] aValues,
int aOffset,
int aLength)
Equivalent to
addAll(size(), aValues, aOffset, aLength . |
default boolean |
addAll(int aStartIndex,
byte[] aValues)
Equivalent to
addAll(aStartIndex, aValues, 0, aValues.length . |
default boolean |
addAll(int aStartIndex,
byte[] aValues,
int aOffset,
int aLength)
Adds
aLength integer values from the given array to this list, starting from the given aOffset |
boolean |
addByte(byte aValue)
Appends the specified value to the end of this list (optional operation).
|
void |
addByte(int aIndex,
byte aValue)
Inserts the specified value at the specified position in this list (optional operation).
|
ILcdByteList |
clone()
Creates and returns a copy of this object.
|
boolean |
containsByte(byte aValue)
Returns
true if this list contains the specified value. |
byte |
getByte(int aIndex)
Returns the value at the specified position in this list.
|
int |
indexOfByte(byte aValue)
Returns the index of the first occurrence of the specified value in this list, or -1 if this list does not
contain the value.
|
int |
lastIndexOfByte(byte aValue)
Returns the index of the last occurrence of the specified value in this list, or -1 if this list does not
contain the value.
|
boolean |
removeByte(byte aValue)
Removes the first occurrence of the specified value from this list, if it is present (optional operation).
|
byte |
removeByte(int aIndex)
Removes the value at the specified position in this list (optional operation).
|
byte |
setByte(int aIndex,
byte aValue)
Replaces the value at the specified position in this list with the specified value (optional operation).
|
byte[] |
toByteArray()
Returns an array containing all of the values in this list in proper sequence (from first to last value).
|
byte[] |
toByteArray(byte[] anArray)
Returns an array containing all of the values in this list in proper sequence (from first to last value);
If the list fits in the specified array, t is returned therein.
|
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
parallelStream, removeIf, stream
byte getByte(int aIndex)
aIndex
- index of the value to returnIndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size())
.byte setByte(int aIndex, byte aValue)
aIndex
- index of the value to replaceaValue
- value to be stored at the specified positionUnsupportedOperationException
- if the set operation is not supported by this listIndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size())
boolean addByte(byte aValue)
aValue
- value to be appended to this listtrue
UnsupportedOperationException
- if the add operation is not supported by this listvoid addByte(int aIndex, byte aValue)
aIndex
- index at which the specified value is to be insertedaValue
- value to be insertedUnsupportedOperationException
- if the add operation is not supported by this listIndexOutOfBoundsException
- if the index is out of range (index < 0 || index > size())
default boolean addAll(byte[] aValues)
addAll(size(), aValues, 0, aValues.length
.addAll(int, byte[], int, int)
default boolean addAll(byte[] aValues, int aOffset, int aLength)
addAll(size(), aValues, aOffset, aLength
.addAll(int, byte[], int, int)
default boolean addAll(int aStartIndex, byte[] aValues)
addAll(aStartIndex, aValues, 0, aValues.length
.addAll(int, byte[], int, int)
default boolean addAll(int aStartIndex, byte[] aValues, int aOffset, int aLength)
aLength
integer values from the given array to this list, starting from the given aOffset
aStartIndex
- The position in this list where to start inserting the given integer values.aValues
- The array containing the integer values to add to this listaOffset
- The offset in aValues
from where to start copying the integer valuesaLength
- The number of integer values to copy from aValues
to this list.IndexOutOfBoundsException
- if aStartIndex
is less than zero or larger than the current size of this list.IndexOutOfBoundsException
- if aOffset
+ aLength
exceeds the length of aValues
IndexOutOfBoundsException
- if aOffset
is negativeIndexOutOfBoundsException
- if aLength
is negativeboolean removeByte(byte aValue)
true
if this list contained the specified value (or equivalently, if this list changed as a
result of the call).aValue
- value to be removed from this list, if presenttrue
if this list contained the specified valueUnsupportedOperationException
- if the remove operation is not supported by this listbyte removeByte(int aIndex)
aIndex
- the index of the value to be removedUnsupportedOperationException
- if the remove operation is not supported by this listIndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size())
byte[] toByteArray()
byte[] toByteArray(byte[] anArray)
anArray
- the array into which the values of this list are to be stored, if it is big enough; otherwise,
a new array is allocated for this purpose.NullPointerException
- if the specified array is nullboolean containsByte(byte aValue)
true
if this list contains the specified value.aValue
- value whose presence in this list is to be testedtrue
if this list contains the specified valueint indexOfByte(byte aValue)
aValue
- value to search forint lastIndexOfByte(byte aValue)
aValue
- value to search forILcdByteList clone()
clone
in interface ILcdCloneable
Object.clone()