Packageandromeda.util.observer
Classpublic class Observable
InheritanceObservable Inheritance CoreObject

This class represents an observable object, or "data" in the model-view paradigm. It can be subclassed to represent an object that the application wants to have observed.



Public Methods
 MethodDefined by
  
Creates an Observable instance with zero Observers.
Observable
  
addObserver(o:Observer):Boolean
Adds an observer to the set of observers for this object, provided that it is not the same as some observer already in the set.
Observable
  
clearChanged():void
Indicates that this object has no longer changed, or that it has already notified all of its observers of its most recent change, so that the hasChanged method will now return false.
Observable
 Inherited
Returns the internal ILogger reference of this ILogable object.
CoreObject
  
hasChanged():Boolean
Tests if this object has changed.
Observable
 Inherited
hashCode():uint
Returns a hashcode value for the object.
CoreObject
  
notifyObservers(arg:*):void
If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the clearChanged method to indicate that this object has no longer changed.
Observable
  
Removes an observer from the set of observers of this object.
Observable
  
setChanged():void
Marks this Observable object as having been changed; the hasChanged method will now return true
Observable
 Inherited
setLogger(log:ILogger = null):void
Sets the internal ILogger reference of this ILogable object.
CoreObject
  
size():Number
Returns the number of observers of this Observable object.
Observable
 Inherited
toSource(indent:int = 0):String
Returns the string representation the source code of the object.
CoreObject
 Inherited
toString():String
Returns the string representation of this instance.
CoreObject
Constructor detail
Observable()constructor
public function Observable()

Creates an Observable instance with zero Observers.

Method detail
addObserver()method
public function addObserver(o:Observer):Boolean

Adds an observer to the set of observers for this object, provided that it is not the same as some observer already in the set.

Parameters
o:Observer

Returns
Boolean
clearChanged()method 
public function clearChanged():void

Indicates that this object has no longer changed, or that it has already notified all of its observers of its most recent change, so that the hasChanged method will now return false.

hasChanged()method 
public function hasChanged():Boolean

Tests if this object has changed.

Returns
Boolean
notifyObservers()method 
public function notifyObservers(arg:*):void

If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the clearChanged method to indicate that this object has no longer changed.

Parameters
arg:*
removeObservers()method 
public function removeObservers(o:Observer):void

Removes an observer from the set of observers of this object.

Parameters
o:Observer
setChanged()method 
public function setChanged():void

Marks this Observable object as having been changed; the hasChanged method will now return true

size()method 
public function size():Number

Returns the number of observers of this Observable object.

Returns
Number — the number of observers of this Observable object.