Package org.h2.mvstore.type
Class ObjectDataType.BigIntegerType
java.lang.Object
org.h2.mvstore.type.BasicDataType<BigInteger>
org.h2.mvstore.type.ObjectDataType.AutoDetectDataType<BigInteger>
org.h2.mvstore.type.ObjectDataType.BigIntegerType
- All Implemented Interfaces:
Comparator<BigInteger>
,DataType<BigInteger>
- Enclosing class:
ObjectDataType
The type for BigInteger objects.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final ObjectDataType.BigIntegerType
The only instance of this type.Fields inherited from class org.h2.mvstore.type.ObjectDataType.AutoDetectDataType
typeId
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
compare
(BigInteger a, BigInteger b) Compare two keys.createStorage
(int size) Create storage object of array type to hold valuesint
getMemory
(BigInteger obj) Calculates the amount of used memory in bytes.read
(ByteBuffer buff) Read an object.read
(ByteBuffer buff, int tag) Read an object from the buffer.void
write
(WriteBuffer buff, 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
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
INSTANCE
The only instance of this type.
-
-
Constructor Details
-
BigIntegerType
private BigIntegerType()
-
-
Method Details
-
createStorage
Description copied from interface:DataType
Create storage object of array type to hold values- Parameters:
size
- number of values to hold- Returns:
- storage object
-
compare
Description copied from interface:DataType
Compare two keys.- Specified by:
compare
in interfaceComparator<BigInteger>
- Specified by:
compare
in interfaceDataType<BigInteger>
- Overrides:
compare
in classBasicDataType<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
Description copied from interface:DataType
Calculates the amount of used memory in bytes.- Specified by:
getMemory
in interfaceDataType<BigInteger>
- Overrides:
getMemory
in classObjectDataType.AutoDetectDataType<BigInteger>
- Parameters:
obj
- the object- Returns:
- the used memory
-
write
Description copied from interface:DataType
Write an object.- Specified by:
write
in interfaceDataType<BigInteger>
- Overrides:
write
in classObjectDataType.AutoDetectDataType<BigInteger>
- Parameters:
buff
- the target bufferx
- the value
-
read
Description copied from interface:DataType
Read an object.- Specified by:
read
in interfaceDataType<BigInteger>
- Specified by:
read
in classBasicDataType<BigInteger>
- Parameters:
buff
- the source buffer- Returns:
- the object
-
read
Description copied from class:ObjectDataType.AutoDetectDataType
Read an object from the buffer.- Specified by:
read
in classObjectDataType.AutoDetectDataType<BigInteger>
- Parameters:
buff
- the buffertag
- the first byte of the object (usually the type)- Returns:
- the read object
-