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
FieldsModifier and TypeFieldDescriptionprotected final Vprotected final ContinuousHashProvider<K> protected final VersionedMapStoreStateImpl<K, V> -
Constructor Summary
ConstructorsConstructorDescriptionVersionedMapStateImpl(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 TypeMethodDescriptionvoidChecks the integrity of the map, and throws an exception if an inconsistency is detected.commit()Saves the state of the object.booleancontentEquals(AnyVersionedMap other) intgetAll()DiffCursor<K, V> getDiffCursor(Version toVersion) longgetSize()voidvoidRestores the state of the object.voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
getDefaultValuein interfaceVersionedMap<K,V>
-
getHashProvider
-
put
- Specified by:
putin interfaceVersionedMap<K,V>
-
putAll
- Specified by:
putAllin interfaceVersionedMap<K,V>
-
get
- Specified by:
getin interfaceVersionedMap<K,V>
-
getSize
public long getSize()- Specified by:
getSizein interfaceAnyVersionedMap
-
getAll
- Specified by:
getAllin interfaceVersionedMap<K,V>
-
getDiffCursor
- Specified by:
getDiffCursorin interfaceVersionedMap<K,V>
-
commit
Description copied from interface:VersionedSaves the state of the object. -
setRoot
-
restore
Description copied from interface:VersionedRestores the state of the object.- Specified by:
restorein interfaceVersioned- Parameters:
state- aVersionobject that marks the version. The state must be aVersionobject returned by a previousVersioned.commit()!
-
prettyPrint
-
checkIntegrity
public void checkIntegrity()Description copied from interface:AnyVersionedMapChecks the integrity of the map, and throws an exception if an inconsistency is detected.- Specified by:
checkIntegrityin interfaceAnyVersionedMap
-
contentHashCode
- Specified by:
contentHashCodein interfaceAnyVersionedMap
-
contentEquals
- Specified by:
contentEqualsin interfaceAnyVersionedMap
-