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 byteprivate static final byteprivate static final byteprivate static final byteprivate static final intprivate static final byteprivate static final byteprivate static final byteprivate static final byteprivate static final byte(package private) final CompareModeprivate static final byteprivate static final intprivate static final byteprivate static final byteprivate static final byteprivate static final ValueDataType.Factoryprivate static final byte(package private) final DataHandlerprivate static final byteprivate static final byteprivate static final byteprivate static final byteprivate static final byteprivate static final intprivate static final byteprivate static final byteprivate static final byteprivate static final byteprivate static final byte(package private) final CastDataProviderprivate static final byteprivate static final byteprivate static final byteprivate RowFactoryprivate static final byte(package private) final int[]private static final byteprivate static final intprivate static final byteprivate static final intprivate static final byteprivate static final byteprivate static final byteprivate static final byteprivate static final intprivate static final byteprivate static final byteprivate static final byte -
Constructor Summary
ConstructorsConstructorDescriptionValueDataType(CastDataProvider provider, CompareMode compareMode, DataHandler handler, int[] sortTypes) ValueDataType(Database database, int[] sortTypes) -
Method Summary
Modifier and TypeMethodDescriptionprivate intintCompare 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.private Value[]readArrayElements(ByteBuffer buff, TypeInfo elementType) private LobDataDatabaseprivate static longreadTimestampTime(ByteBuffer buff) private static intreadTimeZone(ByteBuffer buff) (package private) ValuereadValue(ByteBuffer buff, TypeInfo columnType) Read a value.private static byte[]readVarBytes(ByteBuffer buff) voidsave(WriteBuffer buff, MetaType<Database> metaType) Save the state.voidsetRowFactory(RowFactory rowFactory) voidwrite(WriteBuffer buff, Value v) Write an object.private static voidwriteBinary(byte type, WriteBuffer buff, Value v) private static voidwriteIntArray(WriteBuffer buff, int[] array) static voidwriteLong(WriteBuffer buff, long x) Writes a long.private static voidwriteString(WriteBuffer buff, String s) private static voidwriteTimestampTime(WriteBuffer buff, long nanos) private static voidwriteTimeZone(WriteBuffer buff, int timeZoneOffset) Methods inherited from class BasicDataType
binarySearch, cast, isMemoryEstimationAllowed, read, writeMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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: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
-
compare
-
compareValues
-
getMemory
-
read
Description copied from interface:DataTypeRead an object. -
write
Description copied from interface:DataTypeWrite 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:
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
-
writeIntArray
-
getFactory
- Specified by:
getFactoryin interfaceStatefulDataType<Database>
-