net.jxta.util
Class SimpleSelectable.IdentityReference
java.lang.Object
net.jxta.util.SimpleSelectable.IdentityReference
- Enclosing interface:
- SimpleSelectable
public static class SimpleSelectable.IdentityReference
- extends Object
A simple reference object that can be put in a map instead of the one it refers to.
SimpleSelectable object often need to be put in maps where distinct objects are to be treated
as such, even if they are identical at a semantical level. However, some SimpleSelectable
objects may have semantical equals and hashcode methods rather than the identity ones.
For that reason, whenever a SimpleSelectable needs to be used as a map or set key, its identity
reference should be used instead. All SimpleSelectable can return an identity reference. A given
SimpleSelectable always provides the same IdentityReference object. IdentityReference never overloads
hashcode and equals in a way that could make different objects be equal or that could provide
different results from invocation to invocation.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleSelectable.IdentityReference
public SimpleSelectable.IdentityReference(Object object)
getObject
public Object getObject()
- Returns:
- The object that this one refers to.