Interface KeyAnalyzer<K>

  • All Superinterfaces:
    java.util.Comparator<K>

    public interface KeyAnalyzer<K>
    extends java.util.Comparator<K>
    The KeyAnalyzer provides bit-level access to keys for the PatriciaTrie.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int bitIndex​(K key, K otherKey)
      Returns the index of the first bit that is different in the two keys.
      boolean isBitSet​(K key, int bitIndex)
      Returns true if a key's bit it set at the given index.
      boolean isPrefix​(K key, K prefix)
      Returns true if the second argument is a prefix of the first argument.
      int lengthInBits​(K key)
      Returns the key's length in bits.
      • Methods inherited from interface java.util.Comparator

        compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Method Detail

      • lengthInBits

        int lengthInBits​(K key)
        Returns the key's length in bits.
      • isBitSet

        boolean isBitSet​(K key,
                         int bitIndex)
        Returns true if a key's bit it set at the given index.
      • bitIndex

        int bitIndex​(K key,
                     K otherKey)
        Returns the index of the first bit that is different in the two keys.
      • isPrefix

        boolean isPrefix​(K key,
                         K prefix)
        Returns true if the second argument is a prefix of the first argument.