Class BigDecComparator

    • Constructor Detail

      • BigDecComparator

        public BigDecComparator​(boolean ascending)
    • Method Detail

      • supportsNormalizedKey

        public boolean supportsNormalizedKey()
        Description copied from class: TypeComparator
        Checks whether the data type supports the creation of a normalized key for comparison.
        Specified by:
        supportsNormalizedKey in class TypeComparator<BigDecimal>
        Returns:
        True, if the data type supports the creation of a normalized key for comparison, false otherwise.
      • supportsSerializationWithKeyNormalization

        public boolean supportsSerializationWithKeyNormalization()
        Description copied from class: TypeComparator
        Check whether this comparator supports to serialize the record in a format that replaces its keys by a normalized key.
        Overrides:
        supportsSerializationWithKeyNormalization in class BasicTypeComparator<BigDecimal>
        Returns:
        True, if the comparator supports that specific form of serialization, false if not.
      • getNormalizeKeyLen

        public int getNormalizeKeyLen()
        Description copied from class: TypeComparator
        Gets the number of bytes that the normalized key would maximally take. A value of Integer.MAX_VALUE is interpreted as infinite.
        Specified by:
        getNormalizeKeyLen in class TypeComparator<BigDecimal>
        Returns:
        The number of bytes that the normalized key would maximally take.
      • isNormalizedKeyPrefixOnly

        public boolean isNormalizedKeyPrefixOnly​(int keyBytes)
        Description copied from class: TypeComparator
        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. For example, if the data type is ordered with respect to an integer value it contains, then this method would return true, if the number of key bytes is smaller than four.
        Specified by:
        isNormalizedKeyPrefixOnly in class TypeComparator<BigDecimal>
        Returns:
        True, if the given number of bytes is only a prefix, false otherwise.
      • putNormalizedKey

        public 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. This method adds at most 5 bytes that contain information.
        Specified by:
        putNormalizedKey in class TypeComparator<BigDecimal>
        Parameters:
        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.
        See Also:
        NormalizableKey.copyNormalizedKey(MemorySegment, int, int)
      • duplicate

        public BigDecComparator duplicate()
        Description copied from class: TypeComparator
        Creates a copy of this class. The copy must be deep such that no state set in the copy affects this instance of the comparator class.
        Specified by:
        duplicate in class TypeComparator<BigDecimal>
        Returns:
        A deep copy of this comparator instance.