public class TLcdByteArrayList extends AbstractList<Byte> implements Cloneable, ILcdByteList
ILcdByteList
.modCount
Constructor and Description |
---|
TLcdByteArrayList()
Creates a new, empty
TLcdByteArrayList . |
TLcdByteArrayList(int aInitialCapacity)
Creates a new, empty
TLcdByteArrayList with the specified initial capacity. |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
Byte element) |
boolean |
addAll(Collection<? extends Byte> c) |
boolean |
addAll(int aIndex,
byte[] aValues,
int aOffset,
int aLength)
Adds
aLength integer values from the given array to this list, starting from the given aOffset |
boolean |
addAll(int index,
Collection<? extends Byte> c) |
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).
|
int |
binarySearch(byte aKey)
Performs a binary search on this list.
|
void |
clear() |
TLcdByteArrayList |
clone()
Creates and returns a copy of this object.
|
boolean |
contains(Object aO) |
boolean |
containsByte(byte aValue)
Returns
true if this list contains the specified value. |
void |
ensureCapacity(int minCapacity)
Increases the capacity of this list to the specified capacity.
|
Byte |
get(int index) |
byte |
getByte(int aIndex)
Returns the value at the specified position in this list.
|
int |
indexOf(Object aO) |
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 |
lastIndexOf(Object aO) |
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.
|
Byte |
remove(int index) |
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 |
set(int index,
Byte element) |
byte |
setByte(int aIndex,
byte aValue)
Replaces the value at the specified position in this list with the specified value (optional operation).
|
int |
size() |
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.
|
void |
trimToSize()
Trims the internal data array of this list to match the size of this list.
|
add, equals, hashCode, iterator, listIterator, listIterator, removeRange, subList
containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, addAll, addAll
add, containsAll, equals, hashCode, isEmpty, iterator, listIterator, listIterator, remove, removeAll, replaceAll, retainAll, sort, spliterator, subList, toArray, toArray
parallelStream, removeIf, stream
public TLcdByteArrayList()
TLcdByteArrayList
.public TLcdByteArrayList(int aInitialCapacity)
TLcdByteArrayList
with the specified initial capacity.aInitialCapacity
- the initial capacity of this list.public int size()
size
in interface Collection<Byte>
size
in interface List<Byte>
size
in class AbstractCollection<Byte>
public Byte get(int index)
public void add(int index, Byte element)
public Byte remove(int index)
public byte getByte(int aIndex)
ILcdByteList
getByte
in interface ILcdByteList
aIndex
- index of the value to returnpublic byte setByte(int aIndex, byte aValue)
ILcdByteList
setByte
in interface ILcdByteList
aIndex
- index of the value to replaceaValue
- value to be stored at the specified positionpublic boolean addByte(byte aValue)
ILcdByteList
addByte
in interface ILcdByteList
aValue
- value to be appended to this listtrue
public void addByte(int aIndex, byte aValue)
ILcdByteList
addByte
in interface ILcdByteList
aIndex
- index at which the specified value is to be insertedaValue
- value to be insertedpublic boolean addAll(Collection<? extends Byte> c)
addAll
in interface Collection<Byte>
addAll
in interface List<Byte>
addAll
in class AbstractCollection<Byte>
public boolean addAll(int index, Collection<? extends Byte> c)
public boolean addAll(int aIndex, byte[] aValues, int aOffset, int aLength)
ILcdByteList
aLength
integer values from the given array to this list, starting from the given aOffset
addAll
in interface ILcdByteList
aIndex
- 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.public boolean removeByte(byte aValue)
ILcdByteList
true
if this list contained the specified value (or equivalently, if this list changed as a
result of the call).removeByte
in interface ILcdByteList
aValue
- value to be removed from this list, if presenttrue
if this list contained the specified valuepublic byte removeByte(int aIndex)
ILcdByteList
removeByte
in interface ILcdByteList
aIndex
- the index of the value to be removedpublic byte[] toByteArray()
ILcdByteList
toByteArray
in interface ILcdByteList
public byte[] toByteArray(byte[] anArray)
ILcdByteList
toByteArray
in interface ILcdByteList
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.public void clear()
clear
in interface Collection<Byte>
clear
in interface List<Byte>
clear
in class AbstractList<Byte>
public int binarySearch(byte aKey)
Collections.binarySearch(List, Object)
.
The list must be sorted into ascending order
according to the natural ordering of its
elements (as by the Collections.sort(List)
method) prior to making this
call. If it is not sorted, the results are undefined. If the list
contains multiple elements equal to the specified object, there is no
guarantee which one will be found.aKey
- the value to searchCollections.binarySearch(List, Object)
public TLcdByteArrayList clone()
ILcdByteList
clone
in interface ILcdByteList
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()
public void ensureCapacity(int minCapacity)
minCapacity
- the new capacity for this list.public void trimToSize()
public int indexOf(Object aO)
public int indexOfByte(byte aValue)
ILcdByteList
indexOfByte
in interface ILcdByteList
aValue
- value to search forpublic int lastIndexOf(Object aO)
lastIndexOf
in interface List<Byte>
lastIndexOf
in class AbstractList<Byte>
public int lastIndexOfByte(byte aValue)
ILcdByteList
lastIndexOfByte
in interface ILcdByteList
aValue
- value to search forpublic boolean containsByte(byte aValue)
ILcdByteList
true
if this list contains the specified value.containsByte
in interface ILcdByteList
aValue
- value whose presence in this list is to be testedtrue
if this list contains the specified valuepublic boolean contains(Object aO)
contains
in interface Collection<Byte>
contains
in interface List<Byte>
contains
in class AbstractCollection<Byte>