Package org.h2.mvstore.tx
Class VersionedValueType<T,D>
- All Implemented Interfaces:
Comparator<VersionedValue<T>>,DataType<VersionedValue<T>>,StatefulDataType<D>
public class VersionedValueType<T,D>
extends BasicDataType<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(VersionedValue<T> a, VersionedValue<T> b) Compare two keys.VersionedValue<T>[]createStorage(int size) Create storage object of array type to hold valuesbooleanintgetMemory(VersionedValue<T> v) Calculates the amount of used memory in bytes.inthashCode()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, 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.- Specified by:
getMemoryin interfaceDataType<T>- Specified by:
getMemoryin classBasicDataType<VersionedValue<T>>- Parameters:
v- the object- Returns:
- the used memory
-
read
Description copied from interface:DataTypeRead a list of objects.- Specified by:
readin interfaceDataType<T>- Overrides:
readin classBasicDataType<VersionedValue<T>>- Parameters:
buff- the target bufferstorage- the objectslen- the number of objects to read
-
read
Description copied from interface:DataTypeRead an object.- Specified by:
readin interfaceDataType<T>- Specified by:
readin classBasicDataType<VersionedValue<T>>- Parameters:
buff- the source buffer- Returns:
- the object
-
write
Description copied from interface:DataTypeWrite a list of objects.- Specified by:
writein interfaceDataType<T>- Overrides:
writein classBasicDataType<VersionedValue<T>>- Parameters:
buff- the target bufferstorage- the objectslen- the number of objects to write
-
write
Description copied from interface:DataTypeWrite an object.- Specified by:
writein interfaceDataType<T>- Specified by:
writein classBasicDataType<VersionedValue<T>>- Parameters:
buff- the target bufferv- the value
-
equals
- Specified by:
equalsin interfaceComparator<T>- Overrides:
equalsin classBasicDataType<VersionedValue<T>>
-
hashCode
public int hashCode()- Overrides:
hashCodein classBasicDataType<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<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>
-