Package org.h2.mvstore.db
Class ValueDataType
- All Implemented Interfaces:
Comparator<Value>
,DataType<Value>
,StatefulDataType<Database>
A row type.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte
private static final byte
private static final byte
private static final byte
private static final int
private static final byte
private static final byte
private static final byte
private static final byte
private static final byte
(package private) final CompareMode
private static final byte
private static final int
private static final byte
private static final byte
private static final byte
private static final ValueDataType.Factory
private static final byte
(package private) final DataHandler
private static final byte
private static final byte
private static final byte
private static final byte
private static final byte
private static final int
private static final byte
private static final byte
private static final byte
private static final byte
private static final byte
(package private) final CastDataProvider
private static final byte
private static final byte
private static final byte
private RowFactory
private static final byte
(package private) final int[]
private static final byte
private static final int
private static final byte
private static final int
private static final byte
private static final byte
private static final byte
private static final byte
private static final int
private static final byte
private static final byte
private static final byte
-
Constructor Summary
ConstructorsConstructorDescriptionValueDataType
(CastDataProvider provider, CompareMode compareMode, DataHandler handler, int[] sortTypes) ValueDataType
(Database database, int[] sortTypes) -
Method Summary
Modifier and TypeMethodDescriptionprivate int
int
Compare two keys.int
compareValues
(Value a, Value b, int sortType) Compares the specified values.Value[]
createStorage
(int size) Create storage object of array type to hold valuesboolean
int
Calculates the amount of used memory in bytes.int
hashCode()
read
(ByteBuffer buff) Read an object.private Value[]
readArrayElements
(ByteBuffer buff, TypeInfo elementType) private LobDataDatabase
private static long
readTimestampTime
(ByteBuffer buff) private static int
readTimeZone
(ByteBuffer buff) (package private) Value
readValue
(ByteBuffer buff, TypeInfo columnType) Read a value.private static byte[]
readVarBytes
(ByteBuffer buff) void
save
(WriteBuffer buff, MetaType<Database> metaType) Save the state.void
setRowFactory
(RowFactory rowFactory) void
write
(WriteBuffer buff, Value v) Write an object.private static void
writeBinary
(byte type, WriteBuffer buff, Value v) private static void
writeIntArray
(WriteBuffer buff, int[] array) static void
writeLong
(WriteBuffer buff, long x) Writes a long.private static void
writeString
(WriteBuffer buff, String s) private static void
writeTimestampTime
(WriteBuffer buff, long nanos) private static void
writeTimeZone
(WriteBuffer buff, int timeZoneOffset) Methods inherited from class org.h2.mvstore.type.BasicDataType
binarySearch, cast, isMemoryEstimationAllowed, read, write
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
NULL
private static final byte NULL- See Also:
-
TINYINT
private static final byte TINYINT- See Also:
-
SMALLINT
private static final byte SMALLINT- See Also:
-
INTEGER
private static final byte INTEGER- See Also:
-
BIGINT
private static final byte BIGINT- See Also:
-
NUMERIC
private static final byte NUMERIC- See Also:
-
DOUBLE
private static final byte DOUBLE- See Also:
-
REAL
private static final byte REAL- See Also:
-
TIME
private static final byte TIME- See Also:
-
DATE
private static final byte DATE- See Also:
-
TIMESTAMP
private static final byte TIMESTAMP- See Also:
-
VARBINARY
private static final byte VARBINARY- See Also:
-
VARCHAR
private static final byte VARCHAR- See Also:
-
VARCHAR_IGNORECASE
private static final byte VARCHAR_IGNORECASE- See Also:
-
BLOB
private static final byte BLOB- See Also:
-
CLOB
private static final byte CLOB- See Also:
-
ARRAY
private static final byte ARRAY- See Also:
-
JAVA_OBJECT
private static final byte JAVA_OBJECT- See Also:
-
UUID
private static final byte UUID- See Also:
-
CHAR
private static final byte CHAR- See Also:
-
GEOMETRY
private static final byte GEOMETRY- See Also:
-
TIMESTAMP_TZ_OLD
private static final byte TIMESTAMP_TZ_OLD- See Also:
-
ENUM
private static final byte ENUM- See Also:
-
INTERVAL
private static final byte INTERVAL- See Also:
-
ROW
private static final byte ROW- See Also:
-
INT_0_15
private static final byte INT_0_15- See Also:
-
BIGINT_0_7
private static final byte BIGINT_0_7- See Also:
-
NUMERIC_0_1
private static final byte NUMERIC_0_1- See Also:
-
NUMERIC_SMALL_0
private static final byte NUMERIC_SMALL_0- See Also:
-
NUMERIC_SMALL
private static final byte NUMERIC_SMALL- See Also:
-
DOUBLE_0_1
private static final byte DOUBLE_0_1- See Also:
-
REAL_0_1
private static final byte REAL_0_1- See Also:
-
BOOLEAN_FALSE
private static final byte BOOLEAN_FALSE- See Also:
-
BOOLEAN_TRUE
private static final byte BOOLEAN_TRUE- See Also:
-
INT_NEG
private static final byte INT_NEG- See Also:
-
BIGINT_NEG
private static final byte BIGINT_NEG- See Also:
-
VARCHAR_0_31
private static final byte VARCHAR_0_31- See Also:
-
VARBINARY_0_31
private static final int VARBINARY_0_31- See Also:
-
JSON
private static final int JSON- See Also:
-
TIMESTAMP_TZ
private static final int TIMESTAMP_TZ- See Also:
-
TIME_TZ
private static final int TIME_TZ- See Also:
-
BINARY
private static final int BINARY- See Also:
-
DECFLOAT
private static final int DECFLOAT- See Also:
-
handler
-
provider
-
compareMode
-
sortTypes
final int[] sortTypes -
rowFactory
-
FACTORY
-
-
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:DataType
Create storage object of array type to hold values- Specified by:
createStorage
in interfaceDataType<Value>
- Parameters:
size
- number of values to hold- Returns:
- storage object
-
compare
Description copied from interface:DataType
Compare two keys.- Specified by:
compare
in interfaceComparator<Value>
- Specified by:
compare
in interfaceDataType<Value>
- Overrides:
compare
in 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
-
compare
-
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:DataType
Calculates the amount of used memory in bytes. -
read
Description copied from interface:DataType
Read an object. -
write
Description copied from interface:DataType
Write an object. -
writeBinary
-
writeLong
Writes a long.- Parameters:
buff
- the target bufferx
- the long value
-
writeString
-
writeTimestampTime
-
writeTimeZone
-
readValue
Read a value.- Parameters:
buff
- the source buffercolumnType
- the data type of value, ornull
- Returns:
- the value
-
readLobDataDatabase
-
readArrayElements
-
readVarBytes
-
readTimestampTime
-
readTimeZone
-
equals
- Specified by:
equals
in interfaceComparator<Value>
- Overrides:
equals
in classBasicDataType<Value>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classBasicDataType<Value>
-
save
Description copied from interface:StatefulDataType
Save the state.- Specified by:
save
in interfaceStatefulDataType<Database>
- Parameters:
buff
- the target buffermetaType
- the meta type
-
writeIntArray
-
getFactory
- Specified by:
getFactory
in interfaceStatefulDataType<Database>
-