stamp.util
Class List

java.lang.Object
  |
  +--stamp.util.List
Direct Known Subclasses:
Pool

public class List
extends Object

An ordered list of objects.


Field Summary
protected  Object[] list
           
protected  int numObjects
           
 
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.
 
Methods inherited from class java.lang.Object
equals
 

Field Detail

numObjects

protected int numObjects

list

protected Object[] list
Constructor Detail

List

public List(int maxSize)
Creates a new list with the specified number of entries.
Method Detail

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.