Package org.h2.mvstore.db
Class NullValueDataType
java.lang.Object
org.h2.mvstore.db.NullValueDataType
- All Implemented Interfaces:
Comparator<Value>
,DataType<Value>
Dummy data type used when no value is required. This data type doesn't use
any disk space and always returns SQL NULL value.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
binarySearch
(Value key, Object storage, int size, int initialGuess) Perform binary search for the key within the storageint
Compare two keys.Value[]
createStorage
(int size) Create storage object of array type to hold valuesint
Calculates the amount of used memory in bytes.boolean
Whether memory estimation based on previously seen values is allowed/desirableread
(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.void
write
(WriteBuffer buff, Value obj) Write an object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
INSTANCE
Dummy data type instance.
-
-
Constructor Details
-
NullValueDataType
private NullValueDataType()
-
-
Method Details
-
compare
Description copied from interface:DataType
Compare two keys. -
binarySearch
Description copied from interface:DataType
Perform binary search for the key within the storage- Specified by:
binarySearch
in interfaceDataType<Value>
- Parameters:
key
- to search forstorage
- 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
-
getMemory
Description copied from interface:DataType
Calculates the amount of used memory in bytes. -
isMemoryEstimationAllowed
public boolean isMemoryEstimationAllowed()Description copied from interface:DataType
Whether memory estimation based on previously seen values is allowed/desirable- Specified by:
isMemoryEstimationAllowed
in interfaceDataType<Value>
- Returns:
- true if memory estimation is allowed
-
write
Description copied from interface:DataType
Write an object. -
write
Description copied from interface:DataType
Write a list of objects. -
read
Description copied from interface:DataType
Read an object. -
read
Description copied from interface:DataType
Read a list of objects. -
createStorage
Description copied from interface:DataType
Create storage object of array type to hold values- Specified by:
createStorage
in interfaceDataType<Value>
- Parameters:
size
- number of values to hold- Returns:
- storage object
-