Package repast.simphony.space.continuous
Class SingleOccupancyCoordinateAccessor<T>
- java.lang.Object
-
- repast.simphony.space.continuous.SingleOccupancyCoordinateAccessor<T>
-
- All Implemented Interfaces:
CoordinateAccessor<T,Map<NdPoint,Object>>
public class SingleOccupancyCoordinateAccessor<T> extends Object implements CoordinateAccessor<T,Map<NdPoint,Object>>
Coordinate accessor for a space where each location holds a single object.- Author:
- Nick Collier
-
-
Constructor Summary
Constructors Constructor Description SingleOccupancyCoordinateAccessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get(Map<NdPoint,Object> locationMap, NdPoint location)
Gets the item at the specified location in the map.Iterable<T>
getAll(Map<NdPoint,Object> locationMap, NdPoint location)
Gets all the items at the specified location in the map.T
getRandom(cern.jet.random.Uniform distribution, Map<NdPoint,Object> locationMap, NdPoint location)
Gets a random item from those at the specified location in the map.boolean
put(T obj, Map<NdPoint,Object> locationMap, NdPoint location)
Attempts to put the specified object at the specified location.void
remove(T obj, Map<NdPoint,Object> locationMap, NdPoint location)
Removes the specified object from the location in the map.
-
-
-
Method Detail
-
get
public T get(Map<NdPoint,Object> locationMap, NdPoint location)
Gets the item at the specified location in the map.
-
getAll
public Iterable<T> getAll(Map<NdPoint,Object> locationMap, NdPoint location)
Gets all the items at the specified location in the map.
-
getRandom
public T getRandom(cern.jet.random.Uniform distribution, Map<NdPoint,Object> locationMap, NdPoint location)
Gets a random item from those at the specified location in the map.
-
put
public boolean put(T obj, Map<NdPoint,Object> locationMap, NdPoint location)
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.
-
-