Class BasicDataType<T>
java.lang.Object
org.h2.mvstore.type.BasicDataType<T>
- All Implemented Interfaces:
Comparator<T>, DataType<T>
- Direct Known Subclasses:
ByteArrayDataType, LobStorageMap.BlobMeta.Type, LobStorageMap.BlobReference.Type, LongDataType, MetaType, MVStoreTool.GenericDataType, ObjectDataType, ObjectDataType.AutoDetectDataType, Record.Type, RowDataType, SpatialDataType, StringDataType, ValueDataType, VersionedValueType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbinarySearch(T key, Object storageObj, int size, int initialGuess) Perform binary search for the key within the storageprotected final T[]Cast the storage object to an array of type T.intCompare two keys.booleanabstract intCalculates the amount of used memory in bytes.inthashCode()booleanWhether memory estimation based on previously seen values is allowed/desirableabstract Tread(ByteBuffer buff) Read an object.voidread(ByteBuffer buff, Object storage, int len) Read a list of objects.voidwrite(WriteBuffer buff, Object storage, int len) Write a list of objects.abstract voidwrite(WriteBuffer buff, T obj) Write an object.Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongMethods inherited from interface DataType
createStorage
-
Constructor Details
-
BasicDataType
public BasicDataType()
-
-
Method Details
-
getMemory
-
write
-
read
-
compare
Description copied from interface:DataTypeCompare two keys. -
isMemoryEstimationAllowed
public boolean isMemoryEstimationAllowed()Description copied from interface:DataTypeWhether memory estimation based on previously seen values is allowed/desirable- Specified by:
isMemoryEstimationAllowedin interfaceDataType<T>- Returns:
- true if memory estimation is allowed
-
binarySearch
Description copied from interface:DataTypePerform binary search for the key within the storage- Specified by:
binarySearchin interfaceDataType<T>- Parameters:
key- to search forstorageObj- to search within (an array of type T)size- number of data items in the storageinitialGuess- for key position- Returns:
- index of the key , if found, - index of the insertion point, if not
-
write
-
read
-
hashCode
-
equals
-
cast
-