Package org.h2.mvstore.type
Class ObjectDataType.AutoDetectDataType<T>
java.lang.Object
org.h2.mvstore.type.BasicDataType<T>
org.h2.mvstore.type.ObjectDataType.AutoDetectDataType<T>
- All Implemented Interfaces:
Comparator<T>
,DataType<T>
- Direct Known Subclasses:
ObjectDataType.BigDecimalType
,ObjectDataType.BigIntegerType
,ObjectDataType.BooleanType
,ObjectDataType.ByteType
,ObjectDataType.CharacterType
,ObjectDataType.DateType
,ObjectDataType.DoubleType
,ObjectDataType.FloatType
,ObjectDataType.IntegerType
,ObjectDataType.LongType
,ObjectDataType.NullType
,ObjectDataType.ObjectArrayType
,ObjectDataType.SerializedObjectType
,ObjectDataType.ShortType
,ObjectDataType.StringType
,ObjectDataType.UUIDType
- Enclosing class:
ObjectDataType
The base class for auto-detect data types.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ObjectDataType
(package private) final int
The type id. -
Constructor Summary
ConstructorsConstructorDescriptionAutoDetectDataType
(int typeId) AutoDetectDataType
(ObjectDataType base, int typeId) -
Method Summary
Modifier and TypeMethodDescriptionint
Calculates the amount of used memory in bytes.Get the type for the given object.(package private) abstract Object
read
(ByteBuffer buff, int tag) Read an object from the buffer.void
write
(WriteBuffer buff, T o) Write an object.Methods inherited from class org.h2.mvstore.type.BasicDataType
binarySearch, cast, compare, equals, hashCode, isMemoryEstimationAllowed, read, 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
Methods inherited from interface org.h2.mvstore.type.DataType
createStorage
-
Field Details
-
base
-
typeId
final int typeIdThe type id.
-
-
Constructor Details
-
AutoDetectDataType
AutoDetectDataType(int typeId) -
AutoDetectDataType
AutoDetectDataType(ObjectDataType base, int typeId)
-
-
Method Details
-
getMemory
Description copied from interface:DataType
Calculates the amount of used memory in bytes. -
write
Description copied from interface:DataType
Write an object. -
getType
Get the type for the given object.- Parameters:
o
- the object- Returns:
- the type
-
read
Read an object from the buffer.- Parameters:
buff
- the buffertag
- the first byte of the object (usually the type)- Returns:
- the read object
-