|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectuchicago.src.sim.topology.space.d2.AbstractObject2DTopology
uchicago.src.sim.topology.space.d2.AbstractObject2DSpace
Base class for grids whose cells can hold one or more occupants. The actual object held in the grid cell is a Object2DLocation object.
| Nested Class Summary | |
class |
AbstractObject2DSpace.Abstract2DLocation
A data structure holding an object and the x and y coordinates of that object. |
| Field Summary | |
protected BaseMatrix |
matrix
|
| Fields inherited from class uchicago.src.sim.topology.space.d2.AbstractObject2DTopology |
locations |
| Constructor Summary | |
AbstractObject2DSpace(java.lang.String type)
|
|
| Method Summary | |
abstract Location |
getLocation(int x,
int y)
Gets the Object2DLocation object at the specified coordinates. |
Location |
getLocation(java.lang.Object obj)
Attempts to get the Location for a specific object. |
BaseMatrix |
getMatrix()
Returns the matrix collection object associated with this 2d grid |
double[] |
getSize()
Gets the dimension of the space |
int |
getSizeX()
|
int |
getSizeY()
|
void |
removeLocation(int x,
int y)
Clears the contents the specified cell. |
void |
removeLocation(Location location)
Clears the contents the specified location. |
void |
trim()
Releases any superfluous memory. |
int |
xnorm(int x)
|
int |
ynorm(int y)
|
| Methods inherited from class uchicago.src.sim.topology.space.d2.AbstractObject2DTopology |
addRelation, distance, getRelations, getRelations, getRelationType, removeRelation, setRelationType |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected BaseMatrix matrix
| Constructor Detail |
public AbstractObject2DSpace(java.lang.String type)
| Method Detail |
public void removeLocation(Location location)
removeLocation in interface Spacelocation - the location to remove from the space
public void removeLocation(int x,
int y)
removeLocation in interface Object2DSpacex - the x coordinate of the cell to cleary - the y coordinate of the cell to clear
public abstract Location getLocation(int x,
int y)
getLocation in interface Object2DSpacex - the x coordinatey - the y coordinate
java.lang.IndexOutOfBoundsException - if the given coordinates are out of
range (x < 0 || x >= xSize || y < 0 || y >= ySize)public Location getLocation(java.lang.Object obj)
Space
getLocation in interface Spacepublic BaseMatrix getMatrix()
public double[] getSize()
Space
getSize in interface Spacepublic int getSizeX()
getSizeX in interface Object2DSpacepublic int getSizeY()
getSizeY in interface Object2DSpacepublic void trim()
trim in interface Object2DSpacepublic int xnorm(int x)
xnorm in interface Object2DSpacepublic int ynorm(int y)
ynorm in interface Object2DSpace
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||