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 Details

    • FastDenseAccessor

      public FastDenseAccessor()
  • Method Details

    • get

      public V get(Object[] locationStorage, GridPoint location)
      Description copied from interface: CellAccessor
      Gets the item at the specified location in the map.
      Specified by:
      get in interface CellAccessor<V,Object[]>
      Parameters:
      locationStorage - the location map to put the object in
      location - the location in the map
      Returns:
      the item at the specified location
    • getAll

      public Iterable<V> getAll(Object[] locationStorage, GridPoint location)
      Description copied from interface: CellAccessor
      Gets all the items at the specified location in the map.
      Specified by:
      getAll in interface CellAccessor<V,Object[]>
      Parameters:
      locationStorage - the location map to retrieve from
      location - the location in the map
      Returns:
      an iterator over all the items at the specified location
    • getRandom

      public V getRandom(Object[] locationStorage, GridPoint location)
      Description copied from interface: CellAccessor
      Gets a random item from those at the specified location in the map.
      Specified by:
      getRandom in interface CellAccessor<V,Object[]>
      Parameters:
      locationStorage - the location map to retrieve from
      location - the location in the map
      Returns:
      a random item at the specified location
    • put

      public boolean put(V obj, Object[] locationStorage, GridPoint location)
      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 interface CellAccessor<V,Object[]>
      Parameters:
      obj - the object to put at the location
      locationStorage - the location map to put the object in
      location - the location in the map
      Returns:
      true if the put was successful, otherwise false.
    • allowsMultiOccupancy

      public boolean allowsMultiOccupancy()
      Specified by:
      allowsMultiOccupancy in interface CellAccessor<V,Object[]>
      Returns:
      true if this cell accessor allows multi occupancy, otherwise false.
    • remove

      public void remove(V obj, Object[] locationStorage, GridPoint location)
      Description copied from interface: CellAccessor
      Removes the specified object from the location in the map.
      Specified by:
      remove in interface CellAccessor<V,Object[]>
      Parameters:
      obj - the object to remove
      locationStorage - the location map to remove the object from
      location - the location in the map