Package | org.puremvc.as3.patterns.observer |
Class | public class Observer |
Implements | IObserver |
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:
See also
Method | Defined by | ||
---|---|---|---|
Observer(notifyMethod:Function, notifyContext:Object)
Constructor.
| Observer | ||
compareNotifyContext(object:Object):Boolean
Compare an object to the notification context.
| Observer | ||
notifyObserver(notification:INotification):void
Notify the interested object.
| Observer | ||
setNotifyContext(notifyContext:Object):void
Set the notification context.
| Observer | ||
setNotifyMethod(notifyMethod:Function):void
Set the notification method.
| Observer |
Observer | () | constructor |
public function Observer(notifyMethod:Function, notifyContext:Object)
Constructor.
The notification method on the interested object should take
one parameter of type INotification
notifyMethod:Function — the notification method of the interested object
|
|
notifyContext:Object — the notification context of the interested object
|
compareNotifyContext | () | method |
public function compareNotifyContext(object:Object):Boolean
Compare an object to the notification context.
Parametersobject:Object — the object to compare
|
Boolean — boolean indicating if the object and the notification context are the same
|
notifyObserver | () | method |
public function notifyObserver(notification:INotification):void
Notify the interested object.
Parametersnotification:INotification — the INotification to pass to the interested object's notification method.
|
setNotifyContext | () | method |
public function setNotifyContext(notifyContext:Object):void
Set the notification context.
ParametersnotifyContext:Object — the notification context (this) of the interested object.
|
setNotifyMethod | () | method |
public function setNotifyMethod(notifyMethod:Function):void
Set the notification method.
The notification method should take one parameter of type INotification
.
notifyMethod:Function — the notification (callback) method of the interested object.
|