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

abstract static class ObjectDataType.AutoDetectDataType<T> extends BasicDataType<T>
The base class for auto-detect data types.
  • Field Details

    • base

      private final ObjectDataType base
    • typeId

      final int typeId
      The type id.
  • Constructor Details

    • AutoDetectDataType

      AutoDetectDataType(int typeId)
    • AutoDetectDataType

      AutoDetectDataType(ObjectDataType base, int typeId)
  • Method Details

    • getMemory

      public int getMemory(T o)
      Description copied from interface: DataType
      Calculates the amount of used memory in bytes.
      Specified by:
      getMemory in interface DataType<T>
      Specified by:
      getMemory in class BasicDataType<T>
      Parameters:
      o - the object
      Returns:
      the used memory
    • write

      public void write(WriteBuffer buff, T o)
      Description copied from interface: DataType
      Write an object.
      Specified by:
      write in interface DataType<T>
      Specified by:
      write in class BasicDataType<T>
      Parameters:
      buff - the target buffer
      o - the value
    • getType

      DataType<Object> getType(Object o)
      Get the type for the given object.
      Parameters:
      o - the object
      Returns:
      the type
    • read

      abstract Object read(ByteBuffer buff, int tag)
      Read an object from the buffer.
      Parameters:
      buff - the buffer
      tag - the first byte of the object (usually the type)
      Returns:
      the read object