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:
java.util.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
abstract static class ObjectDataType.AutoDetectDataType<T> extends BasicDataType<T>
The base class for auto-detect data types.
-
-
Field Summary
Fields Modifier and Type Field Description private ObjectDataTypebase(package private) inttypeIdThe type id.
-
Constructor Summary
Constructors Constructor Description AutoDetectDataType(int typeId)AutoDetectDataType(ObjectDataType base, int typeId)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intgetMemory(T o)Calculates the amount of used memory in bytes.(package private) DataType<java.lang.Object>getType(java.lang.Object o)Get the type for the given object.(package private) abstract java.lang.Objectread(java.nio.ByteBuffer buff, int tag)Read an object from the buffer.voidwrite(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 Detail
-
base
private final ObjectDataType base
-
typeId
final int typeId
The type id.
-
-
Constructor Detail
-
AutoDetectDataType
AutoDetectDataType(int typeId)
-
AutoDetectDataType
AutoDetectDataType(ObjectDataType base, int typeId)
-
-
Method Detail
-
getMemory
public int getMemory(T o)
Description copied from interface:DataTypeCalculates the amount of used memory in bytes.
-
write
public void write(WriteBuffer buff, T o)
Description copied from interface:DataTypeWrite an object.
-
getType
DataType<java.lang.Object> getType(java.lang.Object o)
Get the type for the given object.- Parameters:
o- the object- Returns:
- the type
-
read
abstract java.lang.Object read(java.nio.ByteBuffer buff, int tag)Read an object from the buffer.- Parameters:
buff- the buffertag- the first byte of the object (usually the type)- Returns:
- the read object
-
-