edu.stanford.nlp.util
Class IdentityWrapper

java.lang.Object
  extended byedu.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)

Constructor Summary
IdentityWrapper(Object o)
           
 
Method Summary
 boolean equals(Object o)
           
 Object getObject()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IdentityWrapper

public IdentityWrapper(Object o)
Method Detail

getObject

public Object getObject()

hashCode

public int hashCode()

equals

public boolean equals(Object o)

toString

public String toString()


Stanford NLP Group