Interface BLink.SizeEvaluator<X,​Y>

  • Enclosing class:
    BLink<K extends Comparable<K>,​V>

    public static interface BLink.SizeEvaluator<X,​Y>
    Support structure to evaluates memory byte size occupancy of keys and values
    Author:
    diego.salvi
    • Method Detail

      • evaluateKey

        long evaluateKey​(X key)
        Evaluate the key size only
      • evaluateValue

        long evaluateValue​(Y value)
        Evaluate the value size only
      • evaluateAll

        long evaluateAll​(X key,
                         Y value)
        Evaluate both key and value size
      • isKeySizeConstant

        default boolean isKeySizeConstant()
        Check if handled keys have a constant byte size or it changes from key to key.
        Returns:
        true if key size is constant, false otherwise
      • isValueSizeConstant

        default boolean isValueSizeConstant()
        Check if handled value have a constant byte size or it changes from value to value.
        Returns:
        true if value size is constant, false otherwise
      • getPosiviveInfinityKey

        X getPosiviveInfinityKey()
        Returns a value which is greater than all of the other values. Code will check using '==', so this value must be a singleton.
        Returns:
        a value which is greater than every other value