Package org.h2.mvstore.db
Class ValueDataType
- All Implemented Interfaces:
Comparator<Value>,DataType<Value>,StatefulDataType<Database>
A row type.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionValueDataType(CastDataProvider provider, CompareMode compareMode, DataHandler handler, int[] sortTypes) ValueDataType(Database database, int[] sortTypes) -
Method Summary
Modifier and TypeMethodDescriptionintCompare two keys.intcompareValues(Value a, Value b, int sortType) Compares the specified values.Value[]createStorage(int size) Create storage object of array type to hold valuesbooleanintCalculates the amount of used memory in bytes.inthashCode()read(ByteBuffer buff) Read an object.voidsave(WriteBuffer buff, MetaType<Database> metaType) Save the state.voidsetRowFactory(RowFactory rowFactory) voidwrite(WriteBuffer buff, Value v) Write an object.static voidwriteLong(WriteBuffer buff, long x) Writes a long.Methods inherited from class org.h2.mvstore.type.BasicDataType
binarySearch, cast, isMemoryEstimationAllowed, read, writeMethods 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
-
ValueDataType
public ValueDataType() -
ValueDataType
-
ValueDataType
public ValueDataType(CastDataProvider provider, CompareMode compareMode, DataHandler handler, int[] sortTypes)
-
-
Method Details
-
getRowFactory
-
setRowFactory
-
createStorage
Description copied from interface:DataTypeCreate storage object of array type to hold values- Specified by:
createStoragein interfaceDataType<Value>- Parameters:
size- number of values to hold- Returns:
- storage object
-
compare
Description copied from interface:DataTypeCompare two keys.- Specified by:
comparein interfaceComparator<Value>- Specified by:
comparein interfaceDataType<Value>- Overrides:
comparein classBasicDataType<Value>- Parameters:
a- the first keyb- the second key- Returns:
- -1 if the first key is smaller, 1 if larger, and 0 if equal
-
compareValues
Compares the specified values.- Parameters:
a- the first valueb- the second valuesortType- the sorting type- Returns:
- 0 if equal, -1 if first value is smaller for ascending or larger for descending sort type, 1 otherwise
-
getMemory
Description copied from interface:DataTypeCalculates the amount of used memory in bytes. -
read
Description copied from interface:DataTypeRead an object. -
write
Description copied from interface:DataTypeWrite an object. -
writeLong
Writes a long.- Parameters:
buff- the target bufferx- the long value
-
equals
- Specified by:
equalsin interfaceComparator<Value>- Overrides:
equalsin classBasicDataType<Value>
-
hashCode
public int hashCode()- Overrides:
hashCodein classBasicDataType<Value>
-
save
Description copied from interface:StatefulDataTypeSave the state.- Specified by:
savein interfaceStatefulDataType<Database>- Parameters:
buff- the target buffermetaType- the meta type
-
getFactory
- Specified by:
getFactoryin interfaceStatefulDataType<Database>
-