Top Description Fields Constructors Methods
org.h2.mvstore.db

public final Class NullValueDataType

extends Object
implements DataType<Value>
Class Inheritance
All Implemented Interfaces
org.h2.mvstore.type.DataType, java.util.Comparator
Imports
java.nio.ByteBuffer, java.util.Arrays, org.h2.mvstore.WriteBuffer, org.h2.mvstore.type.DataType, org.h2.value.Value, .ValueNull

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

Modifier and TypeField and Description
public static final NullValueDataType
INSTANCE

Dummy data type instance.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
binarySearch(Value
to search for
key
,
Object
to search within (an array of type T)
storage
,
int
number of data items in the storage
size
,
int
for key position
initialGuess
)

Implements org.h2.mvstore.type.DataType.binarySearch.

Perform binary search for the key within the storage

public int
compare(Value
the first key
a
,
Value
the second key
b
)

Implements org.h2.mvstore.type.DataType.compare.

Compare two keys.

public Value[]
createStorage(int
number of values to hold
size
)

Implements org.h2.mvstore.type.DataType.createStorage.

Create storage object of array type to hold values

public int
getMemory(Value
the object
obj
)

Implements org.h2.mvstore.type.DataType.getMemory.

Calculates the amount of used memory in bytes.

public boolean
isMemoryEstimationAllowed()

Implements org.h2.mvstore.type.DataType.isMemoryEstimationAllowed.

Whether memory estimation based on previously seen values is allowed/desirable

public Value
read(ByteBuffer
the source buffer
buff
)

Implements org.h2.mvstore.type.DataType.read.

Read an object.

public void
read(ByteBuffer
the target buffer
buff
,
Object
the objects
storage
,
int
the number of objects to read
len
)

Implements org.h2.mvstore.type.DataType.read.

Read a list of objects.

public void
write(WriteBuffer
the target buffer
buff
,
Value
the value
obj
)

Implements org.h2.mvstore.type.DataType.write.

Write an object.

public void
write(WriteBuffer
the target buffer
buff
,
Object
the objects
storage
,
int
the number of objects to write
len
)

Implements org.h2.mvstore.type.DataType.write.

Write a list of objects.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final NullValueDataType INSTANCE

Dummy data type instance.

Constructor Detail

NullValueDataTypeback to summary
private NullValueDataType()

Method Detail

binarySearchback to summary
public int binarySearch(Value key, Object storage, int size, int initialGuess)

Implements org.h2.mvstore.type.DataType.binarySearch.

Doc from org.h2.mvstore.type.DataType.binarySearch.

Perform binary search for the key within the storage

Parameters
key:Value

to search for

storage:Object

to search within (an array of type T)

size:int

number of data items in the storage

initialGuess:int

for key position

Returns:int

index of the key , if found, - index of the insertion point, if not

Annotations
@Override
compareback to summary
public int compare(Value a, Value b)

Implements org.h2.mvstore.type.DataType.compare.

Doc from org.h2.mvstore.type.DataType.compare.

Compare two keys.

Parameters
a:Value

the first key

b:Value

the second key

Returns:int

-1 if the first key is smaller, 1 if larger, and 0 if equal

Annotations
@Override
createStorageback to summary
public Value[] createStorage(int size)

Implements org.h2.mvstore.type.DataType.createStorage.

Doc from org.h2.mvstore.type.DataType.createStorage.

Create storage object of array type to hold values

Parameters
size:int

number of values to hold

Returns:Value[]

storage object

Annotations
@Override
getMemoryback to summary
public int getMemory(Value obj)

Implements org.h2.mvstore.type.DataType.getMemory.

Doc from org.h2.mvstore.type.DataType.getMemory.

Calculates the amount of used memory in bytes.

Parameters
obj:Value

the object

Returns:int

the used memory

Annotations
@Override
isMemoryEstimationAllowedback to summary
public boolean isMemoryEstimationAllowed()

Implements org.h2.mvstore.type.DataType.isMemoryEstimationAllowed.

Doc from org.h2.mvstore.type.DataType.isMemoryEstimationAllowed.

Whether memory estimation based on previously seen values is allowed/desirable

Returns:boolean

true if memory estimation is allowed

Annotations
@Override
readback to summary
public Value read(ByteBuffer buff)

Implements org.h2.mvstore.type.DataType.read.

Doc from org.h2.mvstore.type.DataType.read.

Read an object.

Parameters
buff:ByteBuffer

the source buffer

Returns:Value

the object

Annotations
@Override
readback to summary
public void read(ByteBuffer buff, Object storage, int len)

Implements org.h2.mvstore.type.DataType.read.

Doc from org.h2.mvstore.type.DataType.read.

Read a list of objects.

Parameters
buff:ByteBuffer

the target buffer

storage:Object

the objects

len:int

the number of objects to read

Annotations
@Override
writeback to summary
public void write(WriteBuffer buff, Value obj)

Implements org.h2.mvstore.type.DataType.write.

Doc from org.h2.mvstore.type.DataType.write.

Write an object.

Parameters
buff:WriteBuffer

the target buffer

obj:Value

the value

Annotations
@Override
writeback to summary
public void write(WriteBuffer buff, Object storage, int len)

Implements org.h2.mvstore.type.DataType.write.

Doc from org.h2.mvstore.type.DataType.write.

Write a list of objects.

Parameters
buff:WriteBuffer

the target buffer

storage:Object

the objects

len:int

the number of objects to write

Annotations
@Override