Class VersionedMapStateImpl<K,V>
java.lang.Object
tools.refinery.store.map.internal.state.VersionedMapStateImpl<K,V>
- Type Parameters:
K
-V
-
- All Implemented Interfaces:
AnyVersionedMap
,Versioned
,VersionedMap<K,
V>
Not threadSafe in itself
-
Field Summary
Modifier and TypeFieldDescriptionprotected final V
protected final ContinuousHashProvider
<K> protected final VersionedMapStoreStateImpl
<K, V> -
Constructor Summary
ConstructorDescriptionVersionedMapStateImpl
(VersionedMapStoreStateImpl<K, V> store, ContinuousHashProvider<K> hashProvider, V defaultValue) VersionedMapStateImpl
(VersionedMapStoreStateImpl<K, V> store, ContinuousHashProvider<K> hashProvider, V defaultValue, Node<K, V> data) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks the integrity of the map, and throws an exception if an inconsistency is detected.commit()
Saves the state of the object.boolean
contentEquals
(AnyVersionedMap other) int
getAll()
DiffCursor
<K, V> getDiffCursor
(Version toVersion) long
getSize()
void
void
Restores the state of the object.void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface tools.refinery.store.map.AnyVersionedMap
equals, hashCode
-
Field Details
-
store
-
hashProvider
-
defaultValue
-
root
-
-
Constructor Details
-
VersionedMapStateImpl
public VersionedMapStateImpl(VersionedMapStoreStateImpl<K, V> store, ContinuousHashProvider<K> hashProvider, V defaultValue) -
VersionedMapStateImpl
public VersionedMapStateImpl(VersionedMapStoreStateImpl<K, V> store, ContinuousHashProvider<K> hashProvider, V defaultValue, Node<K, V> data)
-
-
Method Details
-
getDefaultValue
- Specified by:
getDefaultValue
in interfaceVersionedMap<K,
V>
-
getHashProvider
-
put
- Specified by:
put
in interfaceVersionedMap<K,
V>
-
putAll
- Specified by:
putAll
in interfaceVersionedMap<K,
V>
-
get
- Specified by:
get
in interfaceVersionedMap<K,
V>
-
getSize
public long getSize()- Specified by:
getSize
in interfaceAnyVersionedMap
-
getAll
- Specified by:
getAll
in interfaceVersionedMap<K,
V>
-
getDiffCursor
- Specified by:
getDiffCursor
in interfaceVersionedMap<K,
V>
-
commit
Description copied from interface:Versioned
Saves the state of the object. -
setRoot
-
restore
Description copied from interface:Versioned
Restores the state of the object.- Specified by:
restore
in interfaceVersioned
- Parameters:
state
- aVersion
object that marks the version. The state must be aVersion
object returned by a previousVersioned.commit()
!
-
prettyPrint
-
checkIntegrity
public void checkIntegrity()Description copied from interface:AnyVersionedMap
Checks the integrity of the map, and throws an exception if an inconsistency is detected.- Specified by:
checkIntegrity
in interfaceAnyVersionedMap
-
contentHashCode
- Specified by:
contentHashCode
in interfaceAnyVersionedMap
-
contentEquals
- Specified by:
contentEquals
in interfaceAnyVersionedMap
-