|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ukcrobots.util.ArrayList
A dynamic array-backed list. Based on java.util.ArrayList.
Constructor Summary | |
ArrayList()
Create an array list of default capacity. |
|
ArrayList(int capacity)
Create an array list of required capacity. |
Method Summary | |
boolean |
add(Object obj)
Store a new object at index size(). |
void |
ensureCapacity(int minCapacity)
Ensure that the list is of the given capacity. |
Object |
get(int index)
Return the object at the given index. |
Object |
remove(int index)
Remove the object at the given index. |
Object |
set(int index,
Object element)
Replace the item at the given index with element. |
int |
size()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait |
Constructor Detail |
public ArrayList()
public ArrayList(int capacity)
capacity
- The desired capacity.Method Detail |
public Object get(int index) throws IndexOutOfBoundsException
index
- Which object to return. Must be in the
range [0 ... size()-1]
IndexOutOfBoundsException
- if index is out of bounds.public boolean add(Object obj)
obj
- The object to be stored.public Object remove(int index) throws IndexOutOfBoundsException
index
- The index of the item to be removed.
It must lie in the [0 ... size()-1].
IndexOutOfBoundsException
- if index is out of bounds.public Object set(int index, Object element)
index
- An index in the range 0 .. size()-1element
- The replacement item.
public void ensureCapacity(int minCapacity)
minCapacity
- The minimum capacity.public int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |