|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.puremvc.java.patterns.observer.Observer
public class Observer
A base IObserver implementation.
An Observer is an object that encapsulates information about
an interested object with a method that should be called when a particular
INotification is broadcast.
In PureMVC, the Observer class assumes these responsibilities:
View,
Notification| Constructor Summary | |
|---|---|
Observer(IFunction notify,
java.lang.Object context)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
compareNotifyContext(java.lang.Object object)
Compare an object to the notification context. |
java.lang.Object |
getNotifyContext()
Get the notification context. |
IFunction |
getNotifyMethod()
Get the notification method. |
void |
notifyObserver(INotification notification)
Notify the interested object. |
void |
setNotifyContext(java.lang.Object notifyContext)
Set the notification context. |
void |
setNotifyMethod(IFunction notifyMethod)
Set the notification method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Observer(IFunction notify,
java.lang.Object context)
The notification method on the interested object should take one
parameter of type INotification
notify - the notification method of the interested objectcontext - the notification context of the interested object| Method Detail |
|---|
public boolean compareNotifyContext(java.lang.Object object)
compareNotifyContext in interface IObserverobject - the object to compare
public void notifyObserver(INotification notification)
notifyObserver in interface IObservernotification - the INotification to pass to the interested
object's notification method.public void setNotifyContext(java.lang.Object notifyContext)
setNotifyContext in interface IObservernotifyContext - the notification context (this) of the interested object.public void setNotifyMethod(IFunction notifyMethod)
The notification method should take one parameter of type
INotification.
setNotifyMethod in interface IObservernotifyMethod - the notification (callback) method of the interested object.public IFunction getNotifyMethod()
public java.lang.Object getNotifyContext()
this) of the
interested object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||