edu.jhu.cs.cisst.algorithms.optimize.fmg
Class FMGDefaultObserver

java.lang.Object
  extended by edu.jhu.cs.cisst.algorithms.optimize.fmg.FMGDefaultObserver
All Implemented Interfaces:
java.util.Observer

public class FMGDefaultObserver
extends java.lang.Object
implements java.util.Observer

The default observer for observables of class FMG.

One object of this class is by default registered as an observer of class FMG (the observable). This is used to implement method FMG.waitForResult() within the observer/observable approach.

Author:
Gerald Loeffler (Gerald.Loeffler@univie.ac.at)

Constructor Summary
FMGDefaultObserver()
           
 
Method Summary
 BoundaryGrid getResult()
          return the result of the FMG algorithm that was or will be delivered to this object by calling update().
 void update(java.util.Observable o, java.lang.Object arg)
          will be called if the FMG algorithm (invoced via FMG.fmg()) has produced a result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FMGDefaultObserver

public FMGDefaultObserver()
Method Detail

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
will be called if the FMG algorithm (invoced via FMG.fmg()) has produced a result.

The result of the FMG algorithm is stored inside this object and can be retrieved (from FMG.waitForResult()) via method getResult().

Specified by:
update in interface java.util.Observer
Parameters:
o - the o
arg - the arg
See Also:
FMG.waitForResult()

getResult

public BoundaryGrid getResult()
return the result of the FMG algorithm that was or will be delivered to this object by calling update().

If no result is available, this method blocks the current thread until a result becomes available.

Each result may be retrieved exactly once.

Returns:
the result of the FMG algorithm