public abstract class BasicDataType<T> extends Object implements DataType<T>
| 构造器和说明 |
|---|
BasicDataType() |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
binarySearch(T key,
Object storageObj,
int size,
int initialGuess)
Perform binary search for the key within the storage
|
protected T[] |
cast(Object storage)
Cast the storage object to an array of type T.
|
int |
compare(T a,
T b)
Compare two keys.
|
boolean |
equals(Object obj) |
abstract int |
getMemory(T obj)
Calculates the amount of used memory in bytes.
|
int |
hashCode() |
boolean |
isMemoryEstimationAllowed()
Whether memory estimation based on previously seen values is allowed/desirable
|
abstract T |
read(ByteBuffer buff)
Read an object.
|
void |
read(ByteBuffer buff,
Object storage,
int len)
Read a list of objects.
|
void |
write(WriteBuffer buff,
Object storage,
int len)
Write a list of objects.
|
abstract void |
write(WriteBuffer buff,
T obj)
Write an object.
|
createStoragepublic abstract int getMemory(T obj)
DataTypepublic abstract void write(WriteBuffer buff, T obj)
DataTypepublic abstract T read(ByteBuffer buff)
DataTypepublic boolean isMemoryEstimationAllowed()
DataTypeisMemoryEstimationAllowed 在接口中 DataType<T>public int binarySearch(T key, Object storageObj, int size, int initialGuess)
DataTypebinarySearch 在接口中 DataType<T>key - to search forstorageObj - to search within (an array of type T)size - number of data items in the storageinitialGuess - for key positionpublic void write(WriteBuffer buff, Object storage, int len)
DataTypepublic void read(ByteBuffer buff, Object storage, int len)
DataTypeCopyright © 2022. All rights reserved.