public final class DataStateStoreConcurrentImpl extends java.lang.Object implements DataStateStore
DataStateStore
using the
NonBlockingHashMap
together with a compare-and-swap operation.EMPTY_IMMUTABLE_STATE, EMPTY_STATE_INDEX, NO_ENTRY, START_INDEX
Constructor and Description |
---|
DataStateStoreConcurrentImpl(int initialCapacity) |
Modifier and Type | Method and Description |
---|---|
DataState |
get(int index)
Returns the
DataState that is stored under the specified index. |
int |
putIfAbsent(DataState state)
Stores the
DataState and returns the index that it is stored under. |
int |
size() |
public DataStateStoreConcurrentImpl(int initialCapacity)
public DataState get(int index)
DataStateStore
DataState
that is stored under the specified index.get
in interface DataStateStore
DataState
or NULL, if there is nonepublic int putIfAbsent(DataState state)
DataStateStore
DataState
and returns the index that it is stored under.putIfAbsent
in interface DataStateStore
public int size()
size
in interface DataStateStore
DataState
in this store