agg.util
Class ExtObservable

java.lang.Object
  extended by java.util.Observable
      extended by agg.util.ExtObservable
All Implemented Interfaces:
Disposable
Direct Known Subclasses:
Graph, OrdinaryMorphism

public class ExtObservable
extends java.util.Observable
implements Disposable

An extension of the native Java Observable class that addresses the need for explicit disposure arising from the circular references inherent to the observer pattern (observer knows observable and vice versa). In a multi-layer observer architecture, the disposure command has to be passed way up the observer hierarchy to break the circular references in every layer and thus make the participants amenable for garbage collection.


Constructor Summary
ExtObservable()
           
 
Method Summary
 void dispose()
          Prepare myself for garbage collection.
protected  void finalize()
           
 void setChanged()
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtObservable

public ExtObservable()
Method Detail

dispose

public void dispose()
Prepare myself for garbage collection. A change message Change_ObservableGone with myself as the item is sent out to all of my observers. Subclasses may override this to break their individual circular references, but they should always include a call to this original implementation.

Specified by:
dispose in interface Disposable
See Also:
Change_ObservableGone

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

setChanged

public void setChanged()
Overrides:
setChanged in class java.util.Observable