edu.stanford.nlp.util
Class IdentityWrapper
java.lang.Object
edu.stanford.nlp.util.IdentityWrapper
- public class IdentityWrapper
- extends Object
Wrapper to make an object use identity equality and hashcode. Useful for tricking a WeakHashMap (which exists) into being a WeakIdentityHashMap (which doesn't) or making a HashSet into an IdentityHashSet. Two identity wrappers are equal iff their getObjects are the same object.
- Author:
- Dan Klein (klein@cs.stanford.edu)
IdentityWrapper
public IdentityWrapper(Object o)
getObject
public Object getObject()
hashCode
public int hashCode()
equals
public boolean equals(Object o)
toString
public String toString()
Stanford NLP Group