Package repast.simphony.space.grid
Class SingleOccupancyCellAccessor<T>
java.lang.Object
repast.simphony.space.grid.SingleOccupancyCellAccessor<T>
- All Implemented Interfaces:
CellAccessor<T,
Map<GridPoint, Object>>
public class SingleOccupancyCellAccessor<T>
extends Object
implements CellAccessor<T,Map<GridPoint,Object>>
Coordinate accessor for a space where each location holds a single object.
- Author:
- Nick Collier
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Always returns false.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
-
SingleOccupancyCellAccessor
public SingleOccupancyCellAccessor()
-
-
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 false.- 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.
-