Interface DataType
- All Known Implementing Classes:
ObjectDataType,StringDataType
public interface DataType
A data type.
-
Method Summary
Modifier and TypeMethodDescriptionintCompare two keys.intEstimate the used memory in bytes.read(ByteBuffer buff) Read an object.voidread(ByteBuffer buff, Object[] obj, int len, boolean key) Read a list of objects.voidwrite(WriteBuffer buff, Object obj) Write an object.voidwrite(WriteBuffer buff, Object[] obj, int len, boolean key) Write a list of objects.
-
Method Details
-
compare
Compare two keys.- Parameters:
a- the first keyb- the second key- Returns:
- -1 if the first key is smaller, 1 if larger, and 0 if equal
- Throws:
UnsupportedOperationException- if the type is not orderable
-
getMemory
Estimate the used memory in bytes.- Parameters:
obj- the object- Returns:
- the used memory
-
write
Write an object.- Parameters:
buff- the target bufferobj- the value
-
write
Write a list of objects.- Parameters:
buff- the target bufferobj- the objectslen- the number of objects to writekey- whether the objects are keys
-
read
Read an object.- Parameters:
buff- the source buffer- Returns:
- the object
-
read
Read a list of objects.- Parameters:
buff- the target bufferobj- the objectslen- the number of objects to readkey- whether the objects are keys
-