Package repast.simphony.valueLayer
Class SparseValueLayerStore
- java.lang.Object
-
- repast.simphony.valueLayer.SparseValueLayerStore
-
- All Implemented Interfaces:
ValueLayerStore
public class SparseValueLayerStore extends Object implements ValueLayerStore
Value layer store backed by a sparse map.- Author:
- Eric Tatara
-
-
Field Summary
Fields Modifier and Type Field Description protected double
defaultValue
protected OpenLongToDoubleHashMap
store
-
Constructor Summary
Constructors Constructor Description SparseValueLayerStore(int size, double defaultValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
get(long index)
Get the double value for the specified index.void
set(long index, double value)
Set the double value for the specified index.int
size()
-
-
-
Field Detail
-
defaultValue
protected double defaultValue
-
store
protected OpenLongToDoubleHashMap store
-
-
Method Detail
-
get
public double get(long index)
Description copied from interface:ValueLayerStore
Get the double value for the specified index.- Specified by:
get
in interfaceValueLayerStore
- Returns:
-
set
public void set(long index, double value)
Description copied from interface:ValueLayerStore
Set the double value for the specified index.- Specified by:
set
in interfaceValueLayerStore
-
size
public int size()
- Specified by:
size
in interfaceValueLayerStore
-
-