gnu.trove
Interface TObjectHashingStrategy<T>
- Serializable
public interface TObjectHashingStrategy<T>
extends Serializable
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
$Id: TObjectHashingStrategy.java,v 1.3 2007/06/11 15:26:44 robeden Exp $ int | computeHashCode(T object) - Computes a hash code for the specified object.
|
boolean | equals(T o1, T o2) - Compares o1 and o2 for equality.
|
computeHashCode
public 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.
object
- for which the hashcode is to be computed
equals
public 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.
o1
- an Object
valueo2
- an Object
value
- true if the objects are equal according to this strategy.
GNU Trove is copyright B) 2001-2008 Eric D. Friedman. All Rights Reserved.