public abstract class PrimitiveList
extends java.lang.Object
StringBuffer
does for char
s and
List
does for Object
s.Modifier | Constructor | Description |
---|---|---|
protected |
PrimitiveList(java.lang.Object array,
int size) |
Constructs a list from an initial array object, whose component
type determines the primitive type which this list will work with,
and a size, which indicates number of elements of the array
which are initially considered to constitute the
contents of this list.
|
Modifier and Type | Method | Description |
---|---|---|
protected int |
nextCapacity(int currentCapacity) |
Determines by how much the storage array will grow if it needs to
expand.
|
int |
size() |
Returns the current size of this list.
|
java.lang.Object |
toArray() |
Creates and returns a copy of the contents of this list, in the
form of a primitive array of the right length to hold all the
elements it currently contains.
|
protected PrimitiveList(java.lang.Object array, int size)
array
- array objectsize
- initial list size (note, not capacity)public int size()
public java.lang.Object toArray()
protected int nextCapacity(int currentCapacity)
currentCapacity
is returned, Integer.MAX_VALUE will be
used. The effect of this is that implementations probably do not
need to worry about integer arithmetic overflow.
May be overridden by subclasses.currentCapacity
- initial size of bufferCopyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.