net.aerith.misao.util
Class Operation

java.lang.Object
  |
  +--net.aerith.misao.util.OperationObservable
        |
        +--net.aerith.misao.util.Operation
Direct Known Subclasses:
AdjoiningPixelDetector, BrightnessBasedPairMaker, DefaultBackgroundEstimator, DefaultIdentifier, DefaultImageLoader, DefaultLimitingValueEstimator, DefaultMatchingSolver, DefaultPairMaker, DefaultStarDetector, ExaminationOperator, ExperiencedPairRefiner, IdentificationDeleter, MatchingOperator, MultiTaskOperation, PairingOperator, PositionBasedPairMaker, ProgressivePairMaker, SimilarityBasedPairMaker, StarImageRadiusBasedPairMaker, SupplementaryPairMaker, XmlImageLoader

public abstract class Operation
extends OperationObservable
implements java.lang.Runnable

The Operation represents an operation to be run as a thread.


Field Summary
protected  MonitorSet monitor_set
          The set of monitors.
protected  boolean stopped
          True when this operation must be stopped.
 
Fields inherited from class net.aerith.misao.util.OperationObservable
observer_list
 
Constructor Summary
Operation()
           
 
Method Summary
 void addMonitor(Monitor monitor)
          Adds a monitor.
 boolean isStopped()
          Returns true if the operation is to be stopped.
protected abstract  void operate()
          Operates.
 void perform()
          Performs this operation.
abstract  boolean ready()
          Returns true if the operation is ready to start.
 void run()
          Run this thread.
 void stop()
          Sets the flag to be stopped.
 
Methods inherited from class net.aerith.misao.util.OperationObservable
addObserver, deleteObserver, notifyEnd, notifyFailed, notifyStart, notifySucceeded, notifyWarned
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

monitor_set

protected MonitorSet monitor_set
The set of monitors.

stopped

protected boolean stopped
True when this operation must be stopped.
Constructor Detail

Operation

public Operation()
Method Detail

addMonitor

public void addMonitor(Monitor monitor)
Adds a monitor.
Parameters:
monitor - the monitor.

ready

public abstract boolean ready()
Returns true if the operation is ready to start.
Returns:
true if the operation is ready to start.

perform

public void perform()
             throws java.lang.Exception
Performs this operation.
Throws:
java.lang.Exception - if an error occurs.

operate

protected abstract void operate()
                         throws java.lang.Exception
Operates.
Throws:
java.lang.Exception - if an error occurs.

stop

public void stop()
Sets the flag to be stopped.

isStopped

public boolean isStopped()
Returns true if the operation is to be stopped.

run

public void run()
Run this thread.
Specified by:
run in interface java.lang.Runnable