Package org.h2.mvstore.type
Class ObjectDataType.SerializedObjectType
java.lang.Object
org.h2.mvstore.type.BasicDataType<Object>
org.h2.mvstore.type.ObjectDataType.AutoDetectDataType<Object>
org.h2.mvstore.type.ObjectDataType.SerializedObjectType
- All Implemented Interfaces:
Comparator<Object>
,DataType<Object>
- Enclosing class:
ObjectDataType
The type for serialized objects.
-
Field Summary
FieldsFields inherited from class org.h2.mvstore.type.ObjectDataType.AutoDetectDataType
typeId
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Compare two keys.Object[]
createStorage
(int size) Create storage object of array type to hold valuesint
Calculates the amount of used memory in bytes.read
(ByteBuffer buff) Read an object.read
(ByteBuffer buff, int tag) Read an object from the buffer.void
write
(WriteBuffer buff, Object obj) Write an object.Methods inherited from class org.h2.mvstore.type.ObjectDataType.AutoDetectDataType
getType
Methods inherited from class org.h2.mvstore.type.BasicDataType
binarySearch, cast, equals, hashCode, 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
-
averageSize
private int averageSize
-
-
Constructor Details
-
SerializedObjectType
SerializedObjectType(ObjectDataType base)
-
-
Method Details
-
createStorage
Description copied from interface:DataType
Create storage object of array type to hold values- Parameters:
size
- number of values to hold- Returns:
- storage object
-
compare
Description copied from interface:DataType
Compare two keys.- Specified by:
compare
in interfaceComparator<Object>
- Specified by:
compare
in interfaceDataType<Object>
- Overrides:
compare
in classBasicDataType<Object>
- Parameters:
aObj
- the first keybObj
- the second key- Returns:
- -1 if the first key is smaller, 1 if larger, and 0 if equal
-
getMemory
Description copied from interface:DataType
Calculates the amount of used memory in bytes. -
write
Description copied from interface:DataType
Write an object. -
read
Description copied from interface:DataType
Read an object. -
read
Description copied from class:ObjectDataType.AutoDetectDataType
Read an object from the buffer.- Specified by:
read
in classObjectDataType.AutoDetectDataType<Object>
- Parameters:
buff
- the buffertag
- the first byte of the object (usually the type)- Returns:
- the read object
-