Package repast.simphony.space.grid
Class FastDenseSingleOccuGrid.FastDenseAccessor<V>
java.lang.Object
repast.simphony.space.grid.FastDenseSingleOccuGrid.FastDenseAccessor<V>
- All Implemented Interfaces:
CellAccessor<V,Object[]>
- Enclosing class:
- FastDenseSingleOccuGrid<T>
public static final class FastDenseSingleOccuGrid.FastDenseAccessor<V>
extends Object
implements CellAccessor<V,Object[]>
An acessor for this grid class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets 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.booleanAttempts to put the specified object at the specified location.voidRemoves the specified object from the location in the map.
-
Constructor Details
-
FastDenseAccessor
public FastDenseAccessor()
-
-
Method Details
-
get
Description copied from interface:CellAccessorGets the item at the specified location in the map.- Specified by:
getin interfaceCellAccessor<V,Object[]> - Parameters:
locationStorage- the location map to put the object inlocation- the location in the map- Returns:
- the item at the specified location
-
getAll
Description copied from interface:CellAccessorGets all the items at the specified location in the map.- Specified by:
getAllin interfaceCellAccessor<V,Object[]> - Parameters:
locationStorage- the location map to retrieve fromlocation- the location in the map- Returns:
- an iterator over all the items at the specified location
-
getRandom
Description copied from interface:CellAccessorGets a random item from those at the specified location in the map.- Specified by:
getRandomin interfaceCellAccessor<V,Object[]> - Parameters:
locationStorage- the location map to retrieve fromlocation- the location in the map- Returns:
- a random item at the specified location
-
put
Description copied from interface:CellAccessorAttempts 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.- Specified by:
putin interfaceCellAccessor<V,Object[]> - Parameters:
obj- the object to put at the locationlocationStorage- the location map to put the object inlocation- the location in the map- Returns:
- true if the put was successful, otherwise false.
-
allowsMultiOccupancy
public boolean allowsMultiOccupancy()- Specified by:
allowsMultiOccupancyin interfaceCellAccessor<V,Object[]> - Returns:
- true if this cell accessor allows multi occupancy, otherwise false.
-
remove
Description copied from interface:CellAccessorRemoves the specified object from the location in the map.- Specified by:
removein interfaceCellAccessor<V,Object[]> - Parameters:
obj- the object to removelocationStorage- the location map to remove the object fromlocation- the location in the map
-