public class VersionedValueType<T,D> extends BasicDataType<VersionedValue<T>> implements StatefulDataType<D>
| Modifier and Type | Class and Description |
|---|---|
static class |
VersionedValueType.Factory<D> |
| Constructor and Description |
|---|
VersionedValueType(DataType<T> valueType) |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(VersionedValue<T> a,
VersionedValue<T> b)
Compare two keys.
|
VersionedValue<T>[] |
createStorage(int size)
Create storage object of array type to hold values
|
boolean |
equals(java.lang.Object obj) |
VersionedValueType.Factory<D> |
getFactory() |
int |
getMemory(VersionedValue<T> v)
Calculates the amount of used memory in bytes.
|
int |
hashCode() |
VersionedValue<T> |
read(java.nio.ByteBuffer buff)
Read an object.
|
void |
read(java.nio.ByteBuffer buff,
java.lang.Object storage,
int len)
Read a list of objects.
|
void |
save(WriteBuffer buff,
MetaType<D> metaType)
Save the state.
|
void |
write(WriteBuffer buff,
java.lang.Object storage,
int len)
Write a list of objects.
|
void |
write(WriteBuffer buff,
VersionedValue<T> v)
Write an object.
|
binarySearch, cast, isMemoryEstimationAllowedpublic VersionedValue<T>[] createStorage(int size)
DataTypecreateStorage in interface DataType<VersionedValue<T>>size - number of values to holdpublic int getMemory(VersionedValue<T> v)
DataTypegetMemory in interface DataType<VersionedValue<T>>getMemory in class BasicDataType<VersionedValue<T>>v - the objectpublic void read(java.nio.ByteBuffer buff,
java.lang.Object storage,
int len)
DataTyperead in interface DataType<VersionedValue<T>>read in class BasicDataType<VersionedValue<T>>buff - the target bufferstorage - the objectslen - the number of objects to readpublic VersionedValue<T> read(java.nio.ByteBuffer buff)
DataTyperead in interface DataType<VersionedValue<T>>read in class BasicDataType<VersionedValue<T>>buff - the source bufferpublic void write(WriteBuffer buff, java.lang.Object storage, int len)
DataTypewrite in interface DataType<VersionedValue<T>>write in class BasicDataType<VersionedValue<T>>buff - the target bufferstorage - the objectslen - the number of objects to writepublic void write(WriteBuffer buff, VersionedValue<T> v)
DataTypewrite in interface DataType<VersionedValue<T>>write in class BasicDataType<VersionedValue<T>>buff - the target bufferv - the valuepublic boolean equals(java.lang.Object obj)
equals in interface java.util.Comparator<VersionedValue<T>>equals in class BasicDataType<VersionedValue<T>>public int hashCode()
hashCode in class BasicDataType<VersionedValue<T>>public void save(WriteBuffer buff, MetaType<D> metaType)
StatefulDataTypesave in interface StatefulDataType<D>buff - the target buffermetaType - the meta typepublic int compare(VersionedValue<T> a, VersionedValue<T> b)
DataTypecompare in interface java.util.Comparator<VersionedValue<T>>compare in interface DataType<VersionedValue<T>>compare in class BasicDataType<VersionedValue<T>>a - the first keyb - the second keypublic VersionedValueType.Factory<D> getFactory()
getFactory in interface StatefulDataType<D>