Class Record.Type<K,V>

java.lang.Object
org.h2.mvstore.type.BasicDataType<Record<K,V>>
org.h2.mvstore.tx.Record.Type<K,V>
All Implemented Interfaces:
Comparator<Record<K,V>>, DataType<Record<K,V>>
Enclosing class:
Record<K,V>

static final class Record.Type<K,V> extends BasicDataType<Record<K,V>>
A data type for undo log values
  • Field Details

  • Constructor Details

  • Method Details

    • getMemory

      public int getMemory(Record<K,V> record)
      Description copied from interface: DataType
      Calculates the amount of used memory in bytes.
      Specified by:
      getMemory in interface DataType<K>
      Specified by:
      getMemory in class BasicDataType<Record<K,V>>
      Parameters:
      record - the object
      Returns:
      the used memory
    • compare

      public int compare(Record<K,V> aObj, Record<K,V> bObj)
      Description copied from interface: DataType
      Compare two keys.
      Specified by:
      compare in interface Comparator<K>
      Specified by:
      compare in interface DataType<K>
      Overrides:
      compare in class BasicDataType<Record<K,V>>
      Parameters:
      aObj - the first key
      bObj - the second key
      Returns:
      -1 if the first key is smaller, 1 if larger, and 0 if equal
    • write

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

      public Record<K,V> read(ByteBuffer buff)
      Description copied from interface: DataType
      Read an object.
      Specified by:
      read in interface DataType<K>
      Specified by:
      read in class BasicDataType<Record<K,V>>
      Parameters:
      buff - the source buffer
      Returns:
      the object
    • createStorage

      public Record<K,V>[] createStorage(int size)
      Description copied from interface: DataType
      Create storage object of array type to hold values
      Parameters:
      size - number of values to hold
      Returns:
      storage object