public class IdentityHashingStrategy<K> extends Objectimplements HashingStrategy <K>
HashingStrategy that does identity comparisons (
==) and uses
System.identityHashCode(Object) for hashCode generation.
| Modifier and Type | Field and Description |
|---|---|
static IdentityHashingStrategy |
INSTANCE
A single instance that can be shared with multiple collections.
|
| Constructor and Description |
|---|
IdentityHashingStrategy()
|
| Modifier and Type | Method and Description |
|---|---|
int |
computeHashCode(K object)
Computes a hash code for the specified object.
|
boolean |
equals(K o1, K o2)
Compares o1 and o2 for equality.
|
public static final IdentityHashingStrategy<Object > INSTANCE
public int computeHashCode(K object)
HashingStrategy
computeHashCode in interface
HashingStrategy<K>
object - for which the hashcode is to be computed
public boolean equals(K o1, K o2)
HashingStrategy
equals in interface
HashingStrategy<K>
o1 - an
Object value
o2 - an
Object value