stamp.util
Class List
java.lang.Object
|
+--stamp.util.List
- Direct Known Subclasses:
- Pool
- public class List
- extends Object
An ordered list of objects.
Constructor Summary |
List(int maxSize)
Creates a new list with the specified number of entries. |
Method Summary |
void |
add(int index,
Object o)
Inserts an object at the specified location in the list. |
void |
add(Object o)
Adds an object to the end of the list. |
Object |
get(int index)
Returns the element at the specified position in the list. |
int |
size()
Gets the number of objects in the list. |
numObjects
protected int numObjects
list
protected Object[] list
List
public List(int maxSize)
- Creates a new list with the specified number of entries.
get
public Object get(int index)
- Returns the element at the specified position in the list.
- Parameters:
index
- index of the element to get.- Returns:
- element at the specified position in the list.
add
public void add(Object o)
- Adds an object to the end of the list.
- Parameters:
o
- the object to append to the list.
add
public void add(int index,
Object o)
- Inserts an object at the specified location in the list.
- Parameters:
index
- the index at which to insert the object.o
- the object to insert into the list.
size
public int size()
- Gets the number of objects in the list.
- Returns:
- the number of objects currently in the list.