Package org.h2.mvstore.type
Class ObjectDataType.IntegerType
java.lang.Object
org.h2.mvstore.type.BasicDataType<Integer>
org.h2.mvstore.type.ObjectDataType.AutoDetectDataType<Integer>
org.h2.mvstore.type.ObjectDataType.IntegerType
- All Implemented Interfaces:
Comparator<Integer>,DataType<Integer>
- Enclosing class:
ObjectDataType
The type for integer objects.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final ObjectDataType.IntegerTypeThe 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.Integer[]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, Integer obj) 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
-
IntegerType
private IntegerType()
-
-
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
-
compare
Description copied from interface:DataTypeCompare two keys.- Specified by:
comparein interfaceComparator<Integer>- Specified by:
comparein interfaceDataType<Integer>- Overrides:
comparein classBasicDataType<Integer>- Parameters:
a- the first keyb- the second key- Returns:
- -1 if the first key is smaller, 1 if larger, and 0 if equal
-
getMemory
Description copied from interface:DataTypeCalculates the amount of used memory in bytes. -
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<Integer>- Parameters:
buff- the buffertag- the first byte of the object (usually the type)- Returns:
- the read object
-