## org.h2.mvstore.type
Class StringDataType

    java.lang.Object
      org.h2.mvstore.type.StringDataType

All Implemented Interfaces:
  DataType

    public class StringDataType

extends java.lang.Object
implements DataType

A string type.

Field Summary
`static StringDataType` `INSTANCE`

Constructor Summary
`StringDataType()`

Method Summary
`int` `compare(java.lang.Object a, java.lang.Object b)` Compare two keys.
`int` `getMemory(java.lang.Object obj)` Estimate the used memory in bytes.
`java.lang.String` `read(java.nio.ByteBuffer buff)` Read an object.
`java.nio.ByteBuffer` `write(java.nio.ByteBuffer buff, java.lang.Object obj)` Write the object.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### INSTANCE

    public static final StringDataType INSTANCE

Constructor Detail

### StringDataType

    public StringDataType()

Method Detail

### compare

    public int compare(java.lang.Object a,
                       java.lang.Object b)

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

  Specified by:
    `compare` in interface `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(java.lang.Object obj)

  Description copied from interface: `DataType`
  Estimate the used memory in bytes.

  Specified by:
    `getMemory` in interface `DataType`
  Parameters:
    `obj` - the object
  Returns:
    the used memory

### read

    public java.lang.String read(java.nio.ByteBuffer buff)

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

  Specified by:
    `read` in interface `DataType`
  Parameters:
    `buff` - the source buffer
  Returns:
    the object

### write

    public java.nio.ByteBuffer write(java.nio.ByteBuffer buff,
                                     java.lang.Object obj)

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

  Specified by:
    `write` in interface `DataType`
  Parameters:
    `buff` - the target buffer
    `obj` - the value
  Returns:
    the byte buffer