Package gnu.newtrove

Interface TObjectHashingStrategy<T>

All Superinterfaces:
Equality<T>, Serializable
All Known Implementing Classes:
TObjectIdentityHashingStrategy

public interface TObjectHashingStrategy<T> extends Serializable, Equality<T>
Interface to support pluggable hashing strategies in maps and sets. Implementors can use this interface to make the trove hashing algorithms use object values, values provided by the java runtime, or a custom strategy when computing hashcodes. Created: Sat Aug 17 10:52:32 2002
  • Field Details

  • Method Details

    • computeHashCode

      int computeHashCode(T object)
      Computes a hash code for the specified object. Implementors can use the object's own hashCode method, the Java runtime's identityHashCode, or a custom scheme.
      Parameters:
      object - for which the hashcode is to be computed
      Returns:
      the hashCode
    • equals

      boolean equals(T o1, T o2)
      Compares o1 and o2 for equality. Strategy implementors may use the objects' own equals() methods, compare object references, or implement some custom scheme.
      Specified by:
      equals in interface Equality<T>
      Parameters:
      o1 - an Object value
      o2 - an Object value
      Returns:
      true if the objects are equal according to this strategy.