gnu.trove.strategy.IdentityHashingStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of trove4j Show documentation
Show all versions of trove4j Show documentation
The Trove library provides high speed regular and primitive
collections for Java.
package gnu.trove.strategy;
/**
* A {@link gnu.trove.strategy.HashingStrategy} that does identity comparisons
* (==) and uses {@link System#identityHashCode(Object)} for hashCode generation.
*/
public class IdentityHashingStrategy implements HashingStrategy {
static final long serialVersionUID = -5188534454583764904L;
public int computeHashCode( K object ) {
return System.identityHashCode( object );
}
public boolean equals( K o1, K o2 ) {
return o1 == o2;
}
}