|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.space.AbsMulti2DGrid
uchicago.src.sim.space.AbsMulti2DTorus
uchicago.src.sim.space.OrderedMulti2DTorus
public class OrderedMulti2DTorus
A torus that can hold more than one object in its cells.
The cells themselves store their occupants in order of insertion,
The list of objects in a cell contains the first object
inserted at the beginning of the list and the last object inserted
at the end. The object returned by getObject is a
OrderedCell.
| Field Summary |
|---|
| Fields inherited from class uchicago.src.sim.space.AbsMulti2DGrid |
|---|
matrix, roIter, roList, xSize, ySize |
| Fields inherited from interface uchicago.src.sim.space.Discrete2DSpace |
|---|
MOORE, VON_NEUMANN |
| Constructor Summary | |
|---|---|
OrderedMulti2DTorus(int xSize,
int ySize,
boolean sparse)
Creates this OrderedMulti2DTorus with the specified dimensions. |
|
| Method Summary | |
|---|---|
int |
getIndexOf(int x,
int y,
java.lang.Object obj)
Gets the index of the specified object at the specified location. |
java.lang.Object |
getObjectAt(int x,
int y,
int index)
Gets the object at the specified location and index. |
void |
putObjectAt(int x,
int y,
int index,
java.lang.Object object)
Puts the specified Object into the cell at the specified coordinates and index. |
void |
putObjectAt(int x,
int y,
java.lang.Object object)
Puts the specified Object into the cell at the specified coordinates. |
java.lang.Object |
removeObjectAt(int x,
int y,
int index)
Removes the object at the specified index at the specified location from the grid. |
| Methods inherited from class uchicago.src.sim.space.AbsMulti2DTorus |
|---|
clear, getCellAt, getCellSizeAt, getIteratorAt, getMatrix, getMooreNeighbors, getMooreNeighbors, getMooreNeighborsLoc, getMooreNeighborsLoc, getObjectAt, getObjectsAt, getValueAt, getVNNeighbors, getVNNeighbors, getVNNeighborsLoc, getVNNeighborsLoc, putValueAt, removeObjectAt, trim, xnorm, ynorm |
| Methods inherited from class uchicago.src.sim.space.AbsMulti2DGrid |
|---|
getSize, getSizeX, getSizeY, rangeCheck |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OrderedMulti2DTorus(int xSize,
int ySize,
boolean sparse)
xSize - the number of columns in the gridySize - the number of rows in the gridsparse - whether the grid will be sparsely populated or not| Method Detail |
|---|
public void putObjectAt(int x,
int y,
java.lang.Object object)
putObjectAt in interface Discrete2DSpaceputObjectAt in class AbsMulti2DTorusx - the x coordinatey - the y coordinateobject - the object to put
public void putObjectAt(int x,
int y,
int index,
java.lang.Object object)
Note this will throw an exception if the index is invalid.
x - the x coordinatey - the y coordinateindex - where to insert the specified object relative to
the other objects at this locationobject - the object to put
public java.lang.Object getObjectAt(int x,
int y,
int index)
x - the x coordinatey - the y coordinateindex - the position of the object to get relative to the
other objects in this list.
public int getIndexOf(int x,
int y,
java.lang.Object obj)
x - the x coordinatey - the y coordinateobj - the object to get the index for
public java.lang.Object removeObjectAt(int x,
int y,
int index)
x - the x coordinatey - the y coordinateindex - the index of the object to remove
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||