org.h2.mvstore.db
Class ValueDataType

java.lang.Object
  extended by org.h2.mvstore.db.ValueDataType
All Implemented Interfaces:
DataType

public class ValueDataType
extends java.lang.Object
implements DataType

A row type.


Constructor Summary
ValueDataType(CompareMode compareMode, DataHandler handler, int[] sortTypes)
           
 
Method Summary
 int compare(java.lang.Object a, java.lang.Object b)
          Compare two keys.
 boolean equals(java.lang.Object obj)
           
 int getMemory(java.lang.Object obj)
          Estimate the used memory in bytes.
 int hashCode()
           
 java.lang.Object read(java.nio.ByteBuffer buff)
          Read an object.
 void read(java.nio.ByteBuffer buff, java.lang.Object[] obj, int len, boolean key)
          Read a list of objects.
 void write(WriteBuffer buff, java.lang.Object obj)
          Write an object.
 void write(WriteBuffer buff, java.lang.Object[] obj, int len, boolean key)
          Write a list of objects.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueDataType

public ValueDataType(CompareMode compareMode,
                     DataHandler handler,
                     int[] sortTypes)
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 void read(java.nio.ByteBuffer buff,
                 java.lang.Object[] obj,
                 int len,
                 boolean key)
Description copied from interface: DataType
Read a list of objects.

Specified by:
read in interface DataType
Parameters:
buff - the target buffer
obj - the objects
len - the number of objects to read
key - whether the objects are keys

write

public void write(WriteBuffer buff,
                  java.lang.Object[] obj,
                  int len,
                  boolean key)
Description copied from interface: DataType
Write a list of objects.

Specified by:
write in interface DataType
Parameters:
buff - the target buffer
obj - the objects
len - the number of objects to write
key - whether the objects are keys

read

public java.lang.Object 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 void write(WriteBuffer buff,
                  java.lang.Object obj)
Description copied from interface: DataType
Write an object.

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object