| bak.pcj.list.AbstractByteList bak.pcj.list.ByteArrayList
All known Subclasses: bak.pcj.list.ByteArrayStack,
Field Summary | |
final public static int | DEFAULT_CAPACITY The default capacity of this list. | final public static int | DEFAULT_GROWTH_CHUNK The default chunk size with which to increase the capacity of this list. | final public static double | DEFAULT_GROWTH_FACTOR The default factor with which to increase the capacity of this list. |
Constructor Summary | |
public | ByteArrayList() Creates a new array list with capacity 10 and a relative
growth factor of 1.0. | public | ByteArrayList(ByteCollection c) Creates a new array list with the same elements as a
specified collection. | public | ByteArrayList(byte[] a) Creates a new array list with the same elements as a
specified array. | public | ByteArrayList(int capacity) Creates a new array list with a specified capacity and a
relative growth factor of 1.0. | public | ByteArrayList(int capacity, double growthFactor) Creates a new array list with a specified capacity and
relative growth factor. | public | ByteArrayList(int capacity, int growthChunk) Creates a new array list with a specified capacity and
absolute growth factor.
The array capacity increases to capacity()+growthChunk.
This strategy is good for avoiding wasting memory. |
Method Summary | |
public void | add(int index, byte v) | public int | capacity() Returns the current capacity of this list. | public void | clear() | public Object | clone() Returns a clone of this array list. | public boolean | contains(byte v) | public int | ensureCapacity(int capacity) Ensures that this list has at least a specified capacity.
The actual capacity is calculated from the growth factor
or growth chunk specified to the constructor.
Parameters: capacity - the minimum capacity of this list. | public boolean | equals(Object obj) | public byte | get(int index) | public int | hashCode() | public int | indexOf(byte c) | public int | indexOf(int index, byte c) | public boolean | isEmpty() | public int | lastIndexOf(byte c) | public boolean | remove(byte v) | public byte | removeElementAt(int index) | public byte | set(int index, byte v) | public int | size() | public byte[] | toArray() | public byte[] | toArray(byte[] a) | public void | trimToSize() Minimizes the memory used by this array list. |
DEFAULT_CAPACITY | final public static int DEFAULT_CAPACITY(Code) | | The default capacity of this list.
|
DEFAULT_GROWTH_CHUNK | final public static int DEFAULT_GROWTH_CHUNK(Code) | | The default chunk size with which to increase the capacity of this list.
|
DEFAULT_GROWTH_FACTOR | final public static double DEFAULT_GROWTH_FACTOR(Code) | | The default factor with which to increase the capacity of this list.
|
ByteArrayList | public ByteArrayList(ByteCollection c)(Code) | | Creates a new array list with the same elements as a
specified collection. The elements of the specified collection
are added to the end of the list in the collection's iteration
order.
Parameters: c - the collection whose elements to add to the newlist. throws: NullPointerException - if c is null. |
ByteArrayList | public ByteArrayList(byte[] a)(Code) | | Creates a new array list with the same elements as a
specified array. The elements of the specified array
are added to the end of the list in order of the array.
Parameters: a - the array whose elements to add to the newlist. throws: NullPointerException - if a is null. since: 1.1 |
ByteArrayList | public ByteArrayList(int capacity, double growthFactor)(Code) | | Creates a new array list with a specified capacity and
relative growth factor.
The array capacity increases to capacity()*(1+growthFactor).
This strategy is good for avoiding many capacity increases, but
the amount of wasted memory is approximately the size of the list.
Parameters: capacity - the initial capacity of the list. Parameters: growthFactor - the relative amount with which to increase thethe capacity when a capacity increase is needed. throws: IllegalArgumentException - if capacity is negative;if growthFactor is negative. |
ByteArrayList | public ByteArrayList(int capacity, int growthChunk)(Code) | | Creates a new array list with a specified capacity and
absolute growth factor.
The array capacity increases to capacity()+growthChunk.
This strategy is good for avoiding wasting memory. However, an
overhead is potentially introduced by frequent capacity increases.
Parameters: capacity - the initial capacity of the list. Parameters: growthChunk - the absolute amount with which to increase thethe capacity when a capacity increase is needed. throws: IllegalArgumentException - if capacity is negative;if growthChunk is negative. |
add | public void add(int index, byte v)(Code) | | |
capacity | public int capacity()(Code) | | Returns the current capacity of this list. The capacity is the
number of elements that the list can contain without having to
increase the amount of memory used.
the current capacity of this list. See Also: ByteArrayList.ensureCapacity(int) |
clear | public void clear()(Code) | | |
clone | public Object clone()(Code) | | Returns a clone of this array list.
a clone of this array list. since: 1.1 |
contains | public boolean contains(byte v)(Code) | | |
ensureCapacity | public int ensureCapacity(int capacity)(Code) | | Ensures that this list has at least a specified capacity.
The actual capacity is calculated from the growth factor
or growth chunk specified to the constructor.
Parameters: capacity - the minimum capacity of this list. the new capacity of this list. See Also: ByteArrayList.capacity() |
get | public byte get(int index)(Code) | | |
hashCode | public int hashCode()(Code) | | |
indexOf | public int indexOf(byte c)(Code) | | |
indexOf | public int indexOf(int index, byte c)(Code) | | since: 1.2 |
isEmpty | public boolean isEmpty()(Code) | | |
lastIndexOf | public int lastIndexOf(byte c)(Code) | | |
remove | public boolean remove(byte v)(Code) | | |
removeElementAt | public byte removeElementAt(int index)(Code) | | |
set | public byte set(int index, byte v)(Code) | | |
toArray | public byte[] toArray()(Code) | | |
toArray | public byte[] toArray(byte[] a)(Code) | | |
trimToSize | public void trimToSize()(Code) | | Minimizes the memory used by this array list. The underlying
array is replaced by an array whose size is exactly the number
of elements in this array list. The method can be used to
free up memory after many removals.
|
|
|