GNU Trove

gnu.trove
Class TObjectIdentityHashingStrategy

java.lang.Object
  |
  +--gnu.trove.TObjectIdentityHashingStrategy
All Implemented Interfaces:
java.io.Serializable, TObjectHashingStrategy

public final class TObjectIdentityHashingStrategy
extends java.lang.Object
implements TObjectHashingStrategy

This object hashing strategy uses the System.identityHashCode method to provide identity hash codes. These are identical to the value produced by Object.hashCode(), even when the type of the object being hashed overrides that method. Created: Sat Aug 17 11:13:15 2002

Version:
$Id: TObjectIdentityHashingStrategy.java,v 1.2 2002/08/18 19:14:28 ericdf Exp $
Author:
Eric Friedman
See Also:
Serialized Form

Constructor Summary
TObjectIdentityHashingStrategy()
           
 
Method Summary
 int computeHashCode(java.lang.Object object)
          Delegates hash code computation to the System.identityHashCode(Object) method.
 boolean equals(java.lang.Object o1, java.lang.Object o2)
          Compares object references for equality.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TObjectIdentityHashingStrategy

public TObjectIdentityHashingStrategy()
Method Detail

computeHashCode

public final int computeHashCode(java.lang.Object object)
Delegates hash code computation to the System.identityHashCode(Object) method.

Specified by:
computeHashCode in interface TObjectHashingStrategy
Parameters:
object - for which the hashcode is to be computed
Returns:
the hashCode

equals

public final boolean equals(java.lang.Object o1,
                            java.lang.Object o2)
Compares object references for equality.

Specified by:
equals in interface TObjectHashingStrategy
Parameters:
o1 - an Object value
o2 - an Object value
Returns:
true if o1 == o2

GNU Trove

GNU Trove is copyright © 2001-2003 Eric D. Friedman. All Rights Reserved.