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 semantically 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(SimpleSelectable object)
- Creates a new IdentityReference object
- Parameters:
object
- the selectable
getObject
public SimpleSelectable getObject()
- Returns:
- The object that this one refers to.