Package org.h2.mvstore.tx
Class VersionedValueType<T,D>
java.lang.Object
org.h2.mvstore.type.BasicDataType<org.h2.value.VersionedValue<T>>
org.h2.mvstore.tx.VersionedValueType<T,D>
- All Implemented Interfaces:
Comparator<org.h2.value.VersionedValue<T>>,DataType<org.h2.value.VersionedValue<T>>,StatefulDataType<D>
public class VersionedValueType<T,D>
extends BasicDataType<org.h2.value.VersionedValue<T>>
implements StatefulDataType<D>
The value type for a versioned value.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompare two keys.org.h2.value.VersionedValue<T>[]createStorage(int size) Create storage object of array type to hold valuesbooleanintCalculates the amount of used memory in bytes.inthashCode()org.h2.value.VersionedValue<T>read(ByteBuffer buff) Read an object.voidread(ByteBuffer buff, Object storage, int len) Read a list of objects.voidsave(WriteBuffer buff, MetaType<D> metaType) Save the state.voidwrite(WriteBuffer buff, Object storage, int len) Write a list of objects.voidwrite(WriteBuffer buff, org.h2.value.VersionedValue<T> v) Write an object.Methods inherited from class org.h2.mvstore.type.BasicDataType
binarySearch, cast, isMemoryEstimationAllowedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
VersionedValueType
-
-
Method Details
-
createStorage
Description copied from interface:DataTypeCreate storage object of array type to hold values- Specified by:
createStoragein interfaceDataType<T>- Parameters:
size- number of values to hold- Returns:
- storage object
-
getMemory
Description copied from interface:DataTypeCalculates the amount of used memory in bytes. -
read
Description copied from interface:DataTypeRead a list of objects. -
read
Description copied from interface:DataTypeRead an object. -
write
Description copied from interface:DataTypeWrite a list of objects. -
write
Description copied from interface:DataTypeWrite an object. -
equals
- Specified by:
equalsin interfaceComparator<T>- Overrides:
equalsin classBasicDataType<org.h2.value.VersionedValue<T>>
-
hashCode
public int hashCode()- Overrides:
hashCodein classBasicDataType<org.h2.value.VersionedValue<T>>
-
save
Description copied from interface:StatefulDataTypeSave the state.- Specified by:
savein interfaceStatefulDataType<T>- Parameters:
buff- the target buffermetaType- the meta type
-
compare
Description copied from interface:DataTypeCompare two keys.- Specified by:
comparein interfaceComparator<T>- Specified by:
comparein interfaceDataType<T>- Overrides:
comparein classBasicDataType<org.h2.value.VersionedValue<T>>- Parameters:
a- the first keyb- the second key- Returns:
- -1 if the first key is smaller, 1 if larger, and 0 if equal
-
getFactory
- Specified by:
getFactoryin interfaceStatefulDataType<T>
-