@Internal public final class BigDecComparator extends BasicTypeComparator<BigDecimal>
ascendingComparison
Constructor and Description |
---|
BigDecComparator(boolean ascending) |
Modifier and Type | Method and Description |
---|---|
int |
compareSerialized(DataInputView firstSource,
DataInputView secondSource)
Compares two records in serialized form.
|
BigDecComparator |
duplicate()
Creates a copy of this class.
|
int |
getNormalizeKeyLen()
Gets the number of bytes that the normalized key would maximally take.
|
boolean |
isNormalizedKeyPrefixOnly(int keyBytes)
Checks, whether the given number of bytes for a normalized is only a prefix to determine the
order of elements of the data type for which this comparator provides the comparison methods.
|
void |
putNormalizedKey(BigDecimal record,
MemorySegment target,
int offset,
int len)
Adds a normalized key containing a normalized order of magnitude of the given record. 2 bits
determine the sign (negative, zero, positive), 33 bits determine the magnitude.
|
boolean |
supportsNormalizedKey()
Checks whether the data type supports the creation of a normalized key for comparison.
|
boolean |
supportsSerializationWithKeyNormalization()
Check whether this comparator supports to serialize the record in a format that replaces its
keys by a normalized key.
|
compare, compareToReference, equalToReference, extractKeys, getFlatComparators, hash, invertNormalizedKey, readWithKeyDenormalization, setReference, writeWithKeyNormalization
compareAgainstReference, supportsCompareAgainstReference
public int compareSerialized(DataInputView firstSource, DataInputView secondSource) throws IOException
TypeComparator
Comparator.compare(Object, Object)
.
This method may de-serialize the records or compare them directly based on their binary representation.
compareSerialized
in class TypeComparator<BigDecimal>
firstSource
- The input view containing the first record.secondSource
- The input view containing the second record.Comparator.compare(Object, Object)
.IOException
- Thrown, if any of the input views raised an exception when reading the
records.Comparator.compare(Object, Object)
public boolean supportsNormalizedKey()
TypeComparator
supportsNormalizedKey
in class TypeComparator<BigDecimal>
public boolean supportsSerializationWithKeyNormalization()
TypeComparator
supportsSerializationWithKeyNormalization
in class BasicTypeComparator<BigDecimal>
public int getNormalizeKeyLen()
TypeComparator
Integer
.MAX_VALUE is interpreted as infinite.getNormalizeKeyLen
in class TypeComparator<BigDecimal>
public boolean isNormalizedKeyPrefixOnly(int keyBytes)
TypeComparator
isNormalizedKeyPrefixOnly
in class TypeComparator<BigDecimal>
public void putNormalizedKey(BigDecimal record, MemorySegment target, int offset, int len)
putNormalizedKey
in class TypeComparator<BigDecimal>
record
- The record for which to create the normalized key.target
- The byte array into which to write the normalized key bytes.offset
- The offset in the byte array, where to start writing the normalized key bytes.len
- The number of bytes to be written exactly.NormalizableKey.copyNormalizedKey(MemorySegment, int, int)
public BigDecComparator duplicate()
TypeComparator
duplicate
in class TypeComparator<BigDecimal>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.