Package repast.simphony.space.grid
Class MultiOccupancyCellAccessor<T>
java.lang.Object
repast.simphony.space.grid.MultiOccupancyCellAccessor<T>
- All Implemented Interfaces:
CellAccessor<T,
Map<GridPoint, Object>>
public class MultiOccupancyCellAccessor<T>
extends Object
implements CellAccessor<T,Map<GridPoint,Object>>
Coordinate accessor where a location can hold multiple individual objects. This uses a list to
store the objects in each cell.
- Author:
- Nick Collier
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Always returns true.Gets the item at the specified location in the map.Gets all the items at the specified location in the map.Gets a random item from those at the specified location in the map.boolean
Attempts to put the specified object at the specified location.void
Removes the specified object from the location in the map.
-
Constructor Details
-
MultiOccupancyCellAccessor
public MultiOccupancyCellAccessor()
-
-
Method Details
-
get
Gets the item at the specified location in the map. -
getAll
Gets all the items at the specified location in the map. -
getRandom
Gets a random item from those at the specified location in the map. -
put
Attempts to put the specified object at the specified location. Returns true if the put was successful. The semantics of the result will be determined by implementing classes. -
allowsMultiOccupancy
public boolean allowsMultiOccupancy()Always returns true.- Specified by:
allowsMultiOccupancy
in interfaceCellAccessor<T,
Map<GridPoint, Object>> - Returns:
- true if this cell accessor allows multi occupancy, otherwise false.
-
remove
Removes the specified object from the location in the map.
-