public class ObjectDataType extends BasicDataType<java.lang.Object>
| Constructor and Description |
|---|
ObjectDataType() |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(java.lang.Object a,
java.lang.Object b)
Compare two keys.
|
static int |
compareNotNull(byte[] data1,
byte[] data2)
Compare the contents of two byte arrays.
|
java.lang.Object[] |
createStorage(int size)
Create storage object of array type to hold values
|
static java.lang.Object |
deserialize(byte[] data)
De-serialize the byte array to an object.
|
int |
getMemory(java.lang.Object obj)
Calculates the amount of used memory in bytes.
|
java.lang.Object |
read(java.nio.ByteBuffer buff)
Read an object.
|
static byte[] |
serialize(java.lang.Object obj)
Serialize the object to a byte array.
|
void |
write(WriteBuffer buff,
java.lang.Object obj)
Write an object.
|
binarySearch, cast, equals, hashCode, isMemoryEstimationAllowed, read, writepublic java.lang.Object[] createStorage(int size)
DataTypesize - number of values to holdpublic int compare(java.lang.Object a,
java.lang.Object b)
DataTypecompare in interface java.util.Comparator<java.lang.Object>compare in interface DataType<java.lang.Object>compare in class BasicDataType<java.lang.Object>a - the first keyb - the second keypublic int getMemory(java.lang.Object obj)
DataTypegetMemory in interface DataType<java.lang.Object>getMemory in class BasicDataType<java.lang.Object>obj - the objectpublic void write(WriteBuffer buff, java.lang.Object obj)
DataTypewrite in interface DataType<java.lang.Object>write in class BasicDataType<java.lang.Object>buff - the target bufferobj - the valuepublic java.lang.Object read(java.nio.ByteBuffer buff)
DataTyperead in interface DataType<java.lang.Object>read in class BasicDataType<java.lang.Object>buff - the source bufferpublic static byte[] serialize(java.lang.Object obj)
obj - the object to serializepublic static java.lang.Object deserialize(byte[] data)
data - the byte arraypublic static int compareNotNull(byte[] data1,
byte[] data2)
This method interprets bytes as unsigned.
data1 - the first byte array (must not be null)data2 - the second byte array (must not be null)