Interface KeyComparator<K>

Type Parameters:
K - Key's type
All Superinterfaces:
Serializable
All Known Implementing Classes:
StringIgnoreCaseKeyComparator

public interface KeyComparator<K> extends Serializable
A key comparator.
Author:
Paul Sandoz
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(K x, K y)
    Compare two keys for equality.
    int
    hash(K k)
    Get the hash code of a key.
  • Method Details

    • equals

      boolean equals(K x, K y)
      Compare two keys for equality.
      Parameters:
      x - the first key
      y - the second key
      Returns:
      true if the keys are equal.
    • hash

      int hash(K k)
      Get the hash code of a key.
      Parameters:
      k - the key.
      Returns:
      the hash code of the key.