|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.util.AbstractSimpleSelectable
public abstract class AbstractSimpleSelectable
This a tool to implement selectable objects. It may be composed or extended.
SimpleSelectable
objects that are not SimpleSelector
objects
only report changes to their listeners.
The listeners of a SimpleSelectable
may be SimpleSelector
objects or other SimpleSelectable
objects. However the method to
register non-selectors is and must remain protected since it would allow the
connection of arbitrary listeners.
SimpleSelector
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.jxta.util.SimpleSelectable |
---|
SimpleSelectable.IdentityReference |
Field Summary | |
---|---|
SimpleSelectable.IdentityReference |
identityReference
The identity reference for this selectable. |
Constructor Summary | |
---|---|
AbstractSimpleSelectable()
Standard constructor for cases where the selectable object is this object. |
|
AbstractSimpleSelectable(SimpleSelectable srcObject)
Standard constructor for cases where the selectable object is some other object. |
Method Summary | |
---|---|
SimpleSelectable.IdentityReference |
getIdentityReference()
|
protected boolean |
haveListeners()
Tells whether there are registered selectors right now, or not. |
protected boolean |
notifyChange()
This method tells us that something changed and so we need to notify our selectors by invoking their itemChanged() method. |
void |
register(SimpleSelector simpleSelector)
Registers the given selector with this selectable object. |
protected void |
registerListener(SimpleSelectable selectable)
This method takes any listener, not just a SimpleSelector. |
void |
unregister(SimpleSelector simpleSelector)
Unregisters the given selector, so that it is no-longer notified when this object changes. |
protected void |
unregisterListener(SimpleSelectable selectable)
This method takes any listener, not just a SimpleSelector. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.jxta.util.SimpleSelectable |
---|
itemChanged |
Field Detail |
---|
public final SimpleSelectable.IdentityReference identityReference
SimpleSelectable.IdentityReference
Constructor Detail |
---|
public AbstractSimpleSelectable()
public AbstractSimpleSelectable(SimpleSelectable srcObject)
srcObject
- the source objectMethod Detail |
---|
public SimpleSelectable.IdentityReference getIdentityReference()
getIdentityReference
in interface SimpleSelectable
protected boolean haveListeners()
protected void registerListener(SimpleSelectable selectable)
selectable
- The SimpleSelectable to registerprotected void unregisterListener(SimpleSelectable selectable)
selectable
- The SimpleSelectable to unregisterpublic void register(SimpleSelector simpleSelector)
register
in interface SimpleSelectable
simpleSelector
- The SimpleSelector to registerpublic void unregister(SimpleSelector simpleSelector)
unregister
in interface SimpleSelectable
simpleSelector
- The SimpleSelector to unregisterprotected final boolean notifyChange()
itemChanged()
method. This is
normally invoked internally by the implementation. One of the reasons for
the implementation to invoke this method is that a SimpleSelectable
object that this one is registered with has changed and so has invoked
the itemChanged method. However, the correlation between the two is left
up to the implementation.
No external synchronization needed, nor desirable.
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |