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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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
-
FastDenseAccessor
public FastDenseAccessor()
-
-
Method Details
-
get
Description copied from interface:CellAccessor
Gets the item at the specified location in the map.- Specified by:
get
in 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:CellAccessor
Gets all the items at the specified location in the map.- Specified by:
getAll
in 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:CellAccessor
Gets a random item from those at the specified location in the map.- Specified by:
getRandom
in 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:CellAccessor
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.- Specified by:
put
in 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:
allowsMultiOccupancy
in interfaceCellAccessor<V,
Object[]> - Returns:
- true if this cell accessor allows multi occupancy, otherwise false.
-
remove
Description copied from interface:CellAccessor
Removes the specified object from the location in the map.- Specified by:
remove
in interfaceCellAccessor<V,
Object[]> - Parameters:
obj
- the object to removelocationStorage
- the location map to remove the object fromlocation
- the location in the map
-