Package org.h2.test.store
Class RowDataType
- java.lang.Object
-
- org.h2.mvstore.type.BasicDataType<java.lang.Object[]>
-
- org.h2.test.store.RowDataType
-
- All Implemented Interfaces:
java.util.Comparator<java.lang.Object[]>,DataType<java.lang.Object[]>
public class RowDataType extends BasicDataType<java.lang.Object[]>
A row type.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(java.lang.Object[] ax, java.lang.Object[] bx)Compare two keys.java.lang.Object[][]createStorage(int size)Create storage object of array type to hold valuesintgetMemory(java.lang.Object[] x)Calculates the amount of used memory in bytes.java.lang.Object[]read(java.nio.ByteBuffer buff)Read an object.voidwrite(WriteBuffer buff, java.lang.Object[] x)Write an object.-
Methods inherited from class org.h2.mvstore.type.BasicDataType
binarySearch, cast, equals, hashCode, isMemoryEstimationAllowed, read, write
-
-
-
-
Method Detail
-
createStorage
public java.lang.Object[][] createStorage(int size)
Description copied from interface:DataTypeCreate storage object of array type to hold values- Parameters:
size- number of values to hold- Returns:
- storage object
-
compare
public int compare(java.lang.Object[] ax, java.lang.Object[] bx)Description copied from interface:DataTypeCompare two keys.- Specified by:
comparein interfacejava.util.Comparator<java.lang.Object[]>- Specified by:
comparein interfaceDataType<java.lang.Object[]>- Overrides:
comparein classBasicDataType<java.lang.Object[]>- Parameters:
ax- the first keybx- 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[] x)
Description copied from interface:DataTypeCalculates the amount of used memory in bytes.- Specified by:
getMemoryin interfaceDataType<java.lang.Object[]>- Specified by:
getMemoryin classBasicDataType<java.lang.Object[]>- Parameters:
x- the object- Returns:
- the used memory
-
read
public java.lang.Object[] read(java.nio.ByteBuffer buff)
Description copied from interface:DataTypeRead an object.- Specified by:
readin interfaceDataType<java.lang.Object[]>- Specified by:
readin classBasicDataType<java.lang.Object[]>- Parameters:
buff- the source buffer- Returns:
- the object
-
write
public void write(WriteBuffer buff, java.lang.Object[] x)
Description copied from interface:DataTypeWrite an object.- Specified by:
writein interfaceDataType<java.lang.Object[]>- Specified by:
writein classBasicDataType<java.lang.Object[]>- Parameters:
buff- the target bufferx- the value
-
-