org.h2.mvstore.type

## Class MetaType<D>

- java.lang.Object
- - org.h2.mvstore.type.BasicDataType<DataType<?>>
  - - org.h2.mvstore.type.MetaType<D>

Type Parameters:
  `D` - type of opaque parameter passed as an operational context to Factory.create()

All Implemented Interfaces:
  java.util.Comparator<DataType<?>>, DataType<DataType<?>>

    public final class MetaType<D>
    extends BasicDataType<DataType<?>>

Class DBMetaType is a type for values in the type registry map.

### Constructor Summary

Constructors
Constructor and Description
`MetaType(D database, java.lang.Thread.UncaughtExceptionHandler exceptionHandler)`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `compare(DataType<?> a, DataType<?> b)` Compare two keys.
`DataType<?>[]` `createStorage(int size)` Create storage object of array type to hold values
`int` `getMemory(DataType<?> obj)` Calculates the amount of used memory in bytes.
`DataType<?>` `read(java.nio.ByteBuffer buff)` Read an object.
`void` `write(WriteBuffer buff, DataType<?> obj)` Write an object.

### 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

`comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

### Constructor Detail

#### MetaType

    public MetaType(D database,
                    java.lang.Thread.UncaughtExceptionHandler exceptionHandler)

### Method Detail

#### compare

    public int compare(DataType<?> a,
                       DataType<?> b)

Description copied from interface: `DataType`
Compare two keys.

Specified by:
  `compare` in interface `java.util.Comparator<DataType<?>>`
Specified by:
  `compare` in interface `DataType<DataType<?>>`
Overrides:
  `compare` in class `BasicDataType<DataType<?>>`
Parameters:
  `a` - the first key
  `b` - the second key
Returns:
  -1 if the first key is smaller, 1 if larger, and 0 if equal

#### getMemory

    public int getMemory(DataType<?> obj)

Description copied from interface: `DataType`
Calculates the amount of used memory in bytes.

Specified by:
  `getMemory` in interface `DataType<DataType<?>>`
Specified by:
  `getMemory` in class `BasicDataType<DataType<?>>`
Parameters:
  `obj` - the object
Returns:
  the used memory

#### write

    public void write(WriteBuffer buff,
                      DataType<?> obj)

Description copied from interface: `DataType`
Write an object.

Specified by:
  `write` in interface `DataType<DataType<?>>`
Specified by:
  `write` in class `BasicDataType<DataType<?>>`
Parameters:
  `buff` - the target buffer
  `obj` - the value

#### read

    public DataType<?> read(java.nio.ByteBuffer buff)

Description copied from interface: `DataType`
Read an object.

Specified by:
  `read` in interface `DataType<DataType<?>>`
Specified by:
  `read` in class `BasicDataType<DataType<?>>`
Parameters:
  `buff` - the source buffer
Returns:
  the object

#### createStorage

    public DataType<?>[] 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