public class State extends Object
| Constructor and Description |
|---|
State(StateInterface in)
Construct a new state instance using the specified
StateInterface |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteAll()
Flush all keys in the underlying state storage
|
void |
done()
Inidicate state object will no longer be used
|
void |
initialize()
Initialize state instance
|
<T> StateCursor<T> |
newCursor(Class<T> stateClass,
boolean transaction)
Allocate new state cursor for a set of operations
|
public State(StateInterface in)
StateInterfacein - StateInterface to use for state storagepublic void deleteAll()
throws StateException
StateException - StateExceptionpublic <T> StateCursor<T> newCursor(Class<T> stateClass, boolean transaction) throws StateException
If the transaction flag is true, the new cursor will be allocated as a transaction. In this case be sure to properly commit the transaction in the cursor when complete.
T - Class used in state storagestateClass - Class used in stage storagetransaction - If true, allocate cursor as a transactionStateCursorStateException - StateExceptionpublic void initialize()
throws StateException
The initialize function should be called prior to reading or writing any state using the
State object.
StateException - StateExceptionpublic void done()
The done function must be called to ensure any background threads and resources are released.
Copyright © 2022. All rights reserved.