Package org.h2.mvstore.type
Class ObjectDataType.BigIntegerType
- java.lang.Object
-
- org.h2.mvstore.type.BasicDataType<T>
-
- org.h2.mvstore.type.ObjectDataType.AutoDetectDataType<java.math.BigInteger>
-
- org.h2.mvstore.type.ObjectDataType.BigIntegerType
-
- All Implemented Interfaces:
java.util.Comparator<java.math.BigInteger>,DataType<java.math.BigInteger>
- Enclosing class:
- ObjectDataType
static class ObjectDataType.BigIntegerType extends ObjectDataType.AutoDetectDataType<java.math.BigInteger>
The type for BigInteger objects.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static ObjectDataType.BigIntegerTypeINSTANCEThe only instance of this type.-
Fields inherited from class org.h2.mvstore.type.ObjectDataType.AutoDetectDataType
typeId
-
-
Constructor Summary
Constructors Modifier Constructor Description privateBigIntegerType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(java.math.BigInteger a, java.math.BigInteger b)Compare two keys.java.math.BigInteger[]createStorage(int size)Create storage object of array type to hold valuesintgetMemory(java.math.BigInteger obj)Calculates the amount of used memory in bytes.java.math.BigIntegerread(java.nio.ByteBuffer buff)Read an object.java.math.BigIntegerread(java.nio.ByteBuffer buff, int tag)Read an object from the buffer.voidwrite(WriteBuffer buff, java.math.BigInteger x)Write an object.-
Methods inherited from class org.h2.mvstore.type.ObjectDataType.AutoDetectDataType
getType
-
Methods inherited from class org.h2.mvstore.type.BasicDataType
binarySearch, cast, equals, hashCode, isMemoryEstimationAllowed, read, write
-
-
-
-
Field Detail
-
INSTANCE
static final ObjectDataType.BigIntegerType INSTANCE
The only instance of this type.
-
-
Method Detail
-
createStorage
public java.math.BigInteger[] createStorage(int size)
Description copied from interface:DataTypeCreate storage object of array type to hold values- Parameters:
size- number of values to hold- Returns:
- storage object
-
compare
public int compare(java.math.BigInteger a, java.math.BigInteger b)Description copied from interface:DataTypeCompare two keys.- Specified by:
comparein interfacejava.util.Comparator<java.math.BigInteger>- Specified by:
comparein interfaceDataType<java.math.BigInteger>- Overrides:
comparein classBasicDataType<java.math.BigInteger>- Parameters:
a- the first keyb- the second key- Returns:
- -1 if the first key is smaller, 1 if larger, and 0 if equal
-
getMemory
public int getMemory(java.math.BigInteger obj)
Description copied from interface:DataTypeCalculates the amount of used memory in bytes.- Specified by:
getMemoryin interfaceDataType<java.math.BigInteger>- Overrides:
getMemoryin classObjectDataType.AutoDetectDataType<java.math.BigInteger>- Parameters:
obj- the object- Returns:
- the used memory
-
write
public void write(WriteBuffer buff, java.math.BigInteger x)
Description copied from interface:DataTypeWrite an object.- Specified by:
writein interfaceDataType<java.math.BigInteger>- Overrides:
writein classObjectDataType.AutoDetectDataType<java.math.BigInteger>- Parameters:
buff- the target bufferx- the value
-
read
public java.math.BigInteger read(java.nio.ByteBuffer buff)
Description copied from interface:DataTypeRead an object.- Specified by:
readin interfaceDataType<java.math.BigInteger>- Specified by:
readin classBasicDataType<java.math.BigInteger>- Parameters:
buff- the source buffer- Returns:
- the object
-
read
public java.math.BigInteger read(java.nio.ByteBuffer buff, int tag)Description copied from class:ObjectDataType.AutoDetectDataTypeRead an object from the buffer.- Specified by:
readin classObjectDataType.AutoDetectDataType<java.math.BigInteger>- Parameters:
buff- the buffertag- the first byte of the object (usually the type)- Returns:
- the read object
-
-