uchicago.src.sim.space
Interface IMulti2DGrid

All Superinterfaces:
Discrete2DSpace
All Known Implementing Classes:
AbsMulti2DGrid, AbsMulti2DHexagonalGrid, AbsMulti2DHexagonalTorus, AbsMulti2DTorus, Multi2DGrid, Multi2DHexagonalGrid, Multi2DHexagonalTorus, Multi2DTorus, OrderedMulti2DGrid, OrderedMulti2DHexagonalGrid, OrderedMulti2DHexagonalTorus, OrderedMulti2DTorus

public interface IMulti2DGrid
extends Discrete2DSpace

Interface for grids and tori whose cells can hold more than one object.

Version:
$Revision: 1.5 $ $Date: 2004/11/03 19:50:57 $

Field Summary
 
Fields inherited from interface uchicago.src.sim.space.Discrete2DSpace
MOORE, VON_NEUMANN
 
Method Summary
 Cell getCellAt(int x, int y)
          Gets the Cell object at the specified coordinates.
 int getCellSizeAt(int x, int y)
          Gets the size (number of occupants) of the cell at the specified location.
 java.util.Iterator getIteratorAt(int x, int y)
          Gets the iterator for the collection of objects at the specified coordinates.
 java.util.List getObjectsAt(int x, int y)
          Gets the List of objects at the specified coordinates.
 void removeObjectAt(int x, int y, java.lang.Object obj)
          Removes the specified object from the specified location.
 
Methods inherited from interface uchicago.src.sim.space.Discrete2DSpace
getMatrix, getObjectAt, getSize, getSizeX, getSizeY, getValueAt, putObjectAt, putValueAt
 

Method Detail

getObjectsAt

java.util.List getObjectsAt(int x,
                            int y)
Gets the List of objects at the specified coordinates. An ordered torus will return the first object inserted at the beginning of the list and the last object inserted at the end of the list. The list order is undetermined for an unordered torus.


getIteratorAt

java.util.Iterator getIteratorAt(int x,
                                 int y)
Gets the iterator for the collection of objects at the specified coordinates. For an ordered torus the order of iteration will be first object inserted, first returned and so on. For an unordered torus, order is undefined.


getCellAt

Cell getCellAt(int x,
               int y)
Gets the Cell object at the specified coordinates.


getCellSizeAt

int getCellSizeAt(int x,
                  int y)
Gets the size (number of occupants) of the cell at the specified location.

Parameters:
x - the x coordinate
y - the y coordinate

removeObjectAt

void removeObjectAt(int x,
                    int y,
                    java.lang.Object obj)
Removes the specified object from the specified location.

Parameters:
x - the x coordinate
y - the y coordinate
obj - the object to remove