Package org.h2.mvstore.type
Class ObjectDataType.DateType
java.lang.Object
org.h2.mvstore.type.BasicDataType<Date>
org.h2.mvstore.type.ObjectDataType.AutoDetectDataType<Date>
org.h2.mvstore.type.ObjectDataType.DateType
- All Implemented Interfaces:
Comparator<Date>,DataType<Date>
- Enclosing class:
ObjectDataType
The type for java.util.Date objects.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final ObjectDataType.DateTypeThe only instance of this type.Fields inherited from class org.h2.mvstore.type.ObjectDataType.AutoDetectDataType
typeId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompare two keys.Date[]createStorage(int size) Create storage object of array type to hold valuesintCalculates the amount of used memory in bytes.read(ByteBuffer buff) Read an object.read(ByteBuffer buff, int tag) Read an object from the buffer.voidwrite(WriteBuffer buff, Date a) Write an object.Methods inherited from class org.h2.mvstore.type.ObjectDataType.AutoDetectDataType
getTypeMethods inherited from class org.h2.mvstore.type.BasicDataType
binarySearch, cast, equals, hashCode, 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
-
Field Details
-
INSTANCE
The only instance of this type.
-
-
Constructor Details
-
DateType
private DateType()
-
-
Method Details
-
createStorage
Description copied from interface:DataTypeCreate storage object of array type to hold values- Parameters:
size- number of values to hold- Returns:
- storage object
-
getMemory
Description copied from interface:DataTypeCalculates the amount of used memory in bytes. -
compare
Description copied from interface:DataTypeCompare two keys.- Specified by:
comparein interfaceComparator<Date>- Specified by:
comparein interfaceDataType<Date>- Overrides:
comparein classBasicDataType<Date>- Parameters:
a- the first keyb- the second key- Returns:
- -1 if the first key is smaller, 1 if larger, and 0 if equal
-
write
Description copied from interface:DataTypeWrite an object. -
read
Description copied from interface:DataTypeRead an object. -
read
Description copied from class:ObjectDataType.AutoDetectDataTypeRead an object from the buffer.- Specified by:
readin classObjectDataType.AutoDetectDataType<Date>- Parameters:
buff- the buffertag- the first byte of the object (usually the type)- Returns:
- the read object
-