public class TByteArrayList extends Objectimplements TByteList , Externalizable
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
_data
the data of the list
|
protected int |
_pos
the index after the last entry in the list
|
protected static int |
DEFAULT_CAPACITY
the default capacity for new lists
|
protected byte |
no_entry_value
the byte value that represents null
|
| Modifier | Constructor and Description |
|---|---|
|
TByteArrayList()
Creates a new
TByteArrayList instance with the default capacity.
|
|
TByteArrayList(byte[] values)
Creates a new
TByteArrayList instance whose capacity is the length of
values array and whose initial contents are the specified values.
|
protected |
TByteArrayList(byte[] values, byte no_entry_value, boolean wrap)
|
|
TByteArrayList(int capacity)
Creates a new
TByteArrayList instance with the specified capacity.
|
|
TByteArrayList(int capacity, byte no_entry_value)
Creates a new
TByteArrayList instance with the specified capacity.
|
|
TByteArrayList(TByteCollection
Creates a new
TByteArrayList instance that contains a copy of the collection passed to us.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(byte val)
|
void |
add(byte[] vals)
|
void |
add(byte[] vals, int offset, int length)
|
boolean |
addAll(byte[] array)
|
boolean |
addAll(Collection
|
boolean |
addAll(TByteCollection
|
int |
binarySearch(byte value)
|
int |
binarySearch(byte value, int fromIndex, int toIndex)
|
void |
clear()
|
void |
clear(int capacity)
Flushes the internal state of the list, setting the capacity of the empty list to
capacity.
|
boolean |
contains(byte value)
|
boolean |
containsAll(byte[] array)
|
boolean |
containsAll(Collection
|
boolean |
containsAll(TByteCollection
|
void |
ensureCapacity(int capacity)
Grow the internal array as needed to accommodate the specified number of elements.
|
boolean |
equals(Object
|
void |
fill(byte val)
|
void |
fill(int fromIndex, int toIndex, byte val)
|
boolean |
forEach(TByteProcedure
|
boolean |
forEachDescending(TByteProcedure
|
byte |
get(int offset)
|
byte |
getNoEntryValue()
|
byte |
getQuick(int offset)
Returns the value at the specified offset without doing any bounds checking.
|
TByteList |
grep(TByteProcedure
|
int |
hashCode()
|
int |
indexOf(byte value)
|
int |
indexOf(int offset, byte value)
|
void |
insert(int offset, byte value)
|
void |
insert(int offset, byte[] values)
|
void |
insert(int offset, byte[] values, int valOffset, int len)
|
TByteList |
inverseGrep(TByteProcedure
|
boolean |
isEmpty()
|
TByteIterator |
iterator()
|
int |
lastIndexOf(byte value)
|
int |
lastIndexOf(int offset, byte value)
|
byte |
max()
|
byte |
min()
|
void |
readExternal(ObjectInput
|
boolean |
remove(byte value)
|
void |
remove(int offset, int length)
|
boolean |
removeAll(byte[] array)
|
boolean |
removeAll(Collection
|
boolean |
removeAll(TByteCollection
|
byte |
removeAt(int offset)
|
byte |
replace(int offset, byte val)
|
void |
reset()
Sets the size of the list to 0, but does not change its capacity.
|
void |
resetQuick()
Sets the size of the list to 0, but does not change its capacity.
|
boolean |
retainAll(byte[] array)
|
boolean |
retainAll(Collection
|
boolean |
retainAll(TByteCollection
|
void |
reverse()
|
void |
reverse(int from, int to)
|
byte |
set(int offset, byte val)
|
void |
set(int offset, byte[] values)
|
void |
set(int offset, byte[] values, int valOffset, int length)
|
void |
setQuick(int offset, byte val)
Sets the value at the specified offset without doing any bounds checking.
|
void |
shuffle(Random
|
int |
size()
|
void |
sort()
|
void |
sort(int fromIndex, int toIndex)
|
TByteList |
subList(int begin, int end)
|
byte |
sum()
|
byte[] |
toArray()
|
byte[] |
toArray(byte[] dest)
|
byte[] |
toArray(byte[] dest, int offset, int len)
|
byte[] |
toArray(byte[] dest, int source_pos, int dest_pos, int len)
|
byte[] |
toArray(int offset, int len)
|
String |
toString()
|
void |
transformValues(TByteFunction
|
void |
trimToSize()
Sheds any excess capacity above and beyond the current size of the list.
|
static TByteArrayList |
wrap(byte[] values)
Returns a primitive List implementation that wraps around the given primitive array.
|
static TByteArrayList |
wrap(byte[] values, byte no_entry_value)
Returns a primitive List implementation that wraps around the given primitive array.
|
void |
writeExternal(ObjectOutput
|
protected byte[] _data
protected int _pos
protected static final int DEFAULT_CAPACITY
protected byte no_entry_value
public TByteArrayList()
TByteArrayList instance with the default capacity.
public TByteArrayList(int capacity)
TByteArrayList instance with the specified capacity.
capacity - an
int value
public TByteArrayList(int capacity,
byte no_entry_value)
TByteArrayList instance with the specified capacity.
capacity - an
int value
no_entry_value - an
byte value that represents null.
public TByteArrayList(TByteCollectioncollection)
TByteArrayList instance that contains a copy of the collection passed to us.
collection - the collection to copy
public TByteArrayList(byte[] values)
TByteArrayList instance whose capacity is the length of
values array and whose initial contents are the specified values.
A defensive copy of the given values is held by the new instance.
values - an
byte[] value
protected TByteArrayList(byte[] values,
byte no_entry_value,
boolean wrap)public static TByteArrayListwrap(byte[] values)
values -
public static TByteArrayListwrap(byte[] values, byte no_entry_value)
values -
no_entry_value -
public byte getNoEntryValue()
public void ensureCapacity(int capacity)
public int size()
public boolean isEmpty()
public void trimToSize()
public boolean add(byte val)
public void add(byte[] vals)
public void add(byte[] vals,
int offset,
int length)
public void insert(int offset,
byte value)
public void insert(int offset,
byte[] values)
public void insert(int offset,
byte[] values,
int valOffset,
int len)
public byte get(int offset)
public byte getQuick(int offset)
public byte set(int offset,
byte val)
public byte replace(int offset,
byte val)
public void set(int offset,
byte[] values)
public void set(int offset,
byte[] values,
int valOffset,
int length)
public void setQuick(int offset,
byte val)
public void clear()
public void clear(int capacity)
public void reset()
clear() method if you want to recycle a list without allocating new backing arrays.
public void resetQuick()
clear() method if you want to recycle a list without allocating new backing arrays. This method differs from
reset() in that it does not clear the old values in the backing array. Thus, it is possible for getQuick to return stale data if this method is used and the caller is careless about bounds checking.
public boolean remove(byte value)
public byte removeAt(int offset)
public void remove(int offset,
int length)
public TByteIteratoriterator()
public boolean containsAll(Collection<?> collection)
public boolean containsAll(TByteCollectioncollection)
public boolean containsAll(byte[] array)
public boolean addAll(Collection<? extends Byte > collection)
public boolean addAll(TByteCollectioncollection)
public boolean addAll(byte[] array)
public boolean retainAll(Collection<?> collection)
public boolean retainAll(TByteCollectioncollection)
public boolean retainAll(byte[] array)
public boolean removeAll(Collection<?> collection)
public boolean removeAll(TByteCollectioncollection)
public boolean removeAll(byte[] array)
public void transformValues(TByteFunctionfunction)
public void reverse()
public void reverse(int from,
int to)
public void shuffle(Randomrand)
public TByteListsubList(int begin, int end)
public byte[] toArray()
public byte[] toArray(int offset,
int len)
public byte[] toArray(byte[] dest)
public byte[] toArray(byte[] dest,
int offset,
int len)
public byte[] toArray(byte[] dest,
int source_pos,
int dest_pos,
int len)
public boolean equals(Objectother)
public int hashCode()
public boolean forEach(TByteProcedureprocedure)
public boolean forEachDescending(TByteProcedureprocedure)
public void sort()
public void sort(int fromIndex,
int toIndex)
public void fill(byte val)
public void fill(int fromIndex,
int toIndex,
byte val)
public int binarySearch(byte value)
public int binarySearch(byte value,
int fromIndex,
int toIndex)
public int indexOf(byte value)
public int indexOf(int offset,
byte value)
public int lastIndexOf(byte value)
public int lastIndexOf(int offset,
byte value)
public boolean contains(byte value)
public TByteListgrep(TByteProcedure condition)
public TByteListinverseGrep(TByteProcedure condition)
public byte max()
public byte min()
public byte sum()
public StringtoString()
public void writeExternal(ObjectOutputout) throws IOException
writeExternal in interface
Externalizable
IOException
public void readExternal(ObjectInputin) throws IOException , ClassNotFoundException
readExternal in interface
Externalizable
IOException
ClassNotFoundException