public class LinkedArrayList extends 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(Object o)
Adds a new element to this list.
|
int |
capacityHint()
Returns the capacity hint that indicates the capacity of each buffer segment.
|
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.
|
Object[] |
tail()
Returns the tail buffer segment or null if the list is empty.
|
String |
toString() |
public LinkedArrayList(int capacityHint)
capacityHint
- the hint used for pre-sizing the internal arraypublic void add(Object o)
o
- the object to add, nulls are acceptedpublic Object[] head()
public Object[] tail()
public int size()
public int indexInTail()
public int capacityHint()
Copyright © 2017. All rights reserved.