public class LongDataType extends BasicDataType<java.lang.Long>
| Modifier and Type | Field and Description |
|---|---|
static LongDataType |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
int |
binarySearch(java.lang.Long keyObj,
java.lang.Object storageObj,
int size,
int initialGuess)
Perform binary search for the key within the storage
|
int |
compare(java.lang.Long one,
java.lang.Long two)
Compare two keys.
|
java.lang.Long[] |
createStorage(int size)
Create storage object of array type to hold values
|
int |
getMemory(java.lang.Long obj)
Calculates the amount of used memory in bytes.
|
java.lang.Long |
read(java.nio.ByteBuffer buff)
Read an object.
|
void |
write(WriteBuffer buff,
java.lang.Long data)
Write an object.
|
cast, equals, hashCode, isMemoryEstimationAllowed, read, writepublic static final LongDataType INSTANCE
public int getMemory(java.lang.Long obj)
DataTypegetMemory in interface DataType<java.lang.Long>getMemory in class BasicDataType<java.lang.Long>obj - the objectpublic void write(WriteBuffer buff, java.lang.Long data)
DataTypewrite in interface DataType<java.lang.Long>write in class BasicDataType<java.lang.Long>buff - the target bufferdata - the valuepublic java.lang.Long read(java.nio.ByteBuffer buff)
DataTyperead in interface DataType<java.lang.Long>read in class BasicDataType<java.lang.Long>buff - the source bufferpublic java.lang.Long[] createStorage(int size)
DataTypesize - number of values to holdpublic int compare(java.lang.Long one,
java.lang.Long two)
DataTypecompare in interface java.util.Comparator<java.lang.Long>compare in interface DataType<java.lang.Long>compare in class BasicDataType<java.lang.Long>one - the first keytwo - the second keypublic int binarySearch(java.lang.Long keyObj,
java.lang.Object storageObj,
int size,
int initialGuess)
DataTypebinarySearch in interface DataType<java.lang.Long>binarySearch in class BasicDataType<java.lang.Long>keyObj - to search forstorageObj - to search within (an array of type T)size - number of data items in the storageinitialGuess - for key position