All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gnu.trove.strategy.IdentityHashingStrategy Maven / Gradle / Ivy

Go to download

The Trove library provides high speed regular and primitive collections for Java.

There is a newer version: 3.0.3
Show newest version
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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy