|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.space.OrderedCell
public class OrderedCell
A grid cell whose occupants are stored in order of insertion. The first object inserted will be on the bottom of the stack at position 0, and the last will be on the top at position num_objects - 1.
| Constructor Summary | |
|---|---|
OrderedCell()
|
|
| Method Summary | |
|---|---|
void |
add(java.lang.Object o)
Adds an object to this cell. |
void |
clear()
Clears all the objects from this cell. |
java.lang.Object |
getFirst()
Gets the first (bottom) object in the cell. |
int |
getIndexOf(java.lang.Object o)
Gets the index of the specified object. |
java.lang.Object |
getLast()
Gets the last (top) object in the cell. |
java.util.List |
getList()
Returns a List of the objects contained in this cell. |
java.lang.Object |
getObject(int index)
Gets the object at the specified index. |
void |
insert(int index,
java.lang.Object o)
Inserts the specified object at the specified index. |
java.util.Iterator |
iterator()
Returns an Iterator of the objects contained in this cell. |
java.lang.Object |
remove(int index)
Removes the object at the specified index. |
void |
remove(java.lang.Object o)
Removes the specified object from this cell. |
int |
size()
Gets the number of objects in this cell. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OrderedCell()
| Method Detail |
|---|
public java.lang.Object getFirst()
public java.lang.Object getLast()
public java.lang.Object getObject(int index)
public int size()
size in interface Cellpublic int getIndexOf(java.lang.Object o)
public void insert(int index,
java.lang.Object o)
public java.lang.Object remove(int index)
index - the index of the object to removepublic void clear()
clear in interface Cellpublic void add(java.lang.Object o)
add in interface Cellpublic java.util.List getList()
getList in interface Cellpublic java.util.Iterator iterator()
iterator in interface Cellpublic void remove(java.lang.Object o)
remove in interface Cell
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||