public class LinkedArrayList
extends java.lang.Object
The class is non final to allow embedding it directly and thus saving on object allocation.
| Constructor and Description |
|---|
LinkedArrayList(int capacityHint)
Constructor with the capacity hint of each array segment.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.Object o)
Adds a new element to this list.
|
int |
capacityHint()
Returns the capacity hint that indicates the capacity of each buffer segment.
|
java.lang.Object[] |
head()
Returns the head buffer segment or null if the list is empty.
|
int |
indexInTail()
Returns the index of the next slot in the tail buffer segment.
|
int |
size()
Returns the total size of the list.
|
java.lang.Object[] |
tail()
Returns the tail buffer segment or null if the list is empty.
|
java.lang.String |
toString() |
public LinkedArrayList(int capacityHint)
capacityHint - public void add(java.lang.Object o)
o - the object to add, nulls are acceptedpublic java.lang.Object[] head()
public java.lang.Object[] tail()
public int size()
public int indexInTail()
public int capacityHint()
public java.lang.String toString()
toString in class java.lang.Object