de.cau.cs.kieler.core.alg
Class AbstractAlgorithm

java.lang.Object
  extended by de.cau.cs.kieler.core.alg.AbstractAlgorithm
All Implemented Interfaces:
IAlgorithm
Direct Known Subclasses:
AbstractCrossingMinimizer, AbstractCycleRemover, AbstractForceModel, BalancingLayerAssigner, BalancingNodePlacer, BarycenterCrossingReducer, BasicNodePlacer, BigNodesProcessor, BoxPlacer, BoxSorter, CommentPostprocessor, CommentPreprocessor, ComponentsProcessor, ComponentsProcessor, CompoundCycleProcessor, CompoundDummyEdgeRemover, CompoundGraphRestorer, CompoundSideProcessor, EdgeAndLayerConstraintEdgeReverser, GraphConverter, GraphTransformer, GreedyCycleBreaker, HierarchicalPortConstraintProcessor, HierarchicalPortDummySizeProcessor, HierarchicalPortOrthogonalEdgeRouter, HierarchicalPortPositionProcessor, HyperedgeDummyMerger, HypernodesProcessor, InLayerConstraintProcessor, InteractiveCrossingReducer, InteractiveCycleBreaker, InteractiveLayerer, InvertedPortProcessor, LayerConstraintProcessor, LayerSweepCrossingReducer, LinearSegmentsNodePlacer, LongEdgeJoiner, LongEdgeSplitter, LongestPathLayerAssigner, LongestPathLayerer, NetworkSimplexLayerer, NodeMarginCalculator, NorthSouthPortPostprocessor, NorthSouthPortPreprocessor, OrthogonalEdgeRouter, PolylineEdgeRouter, PortListSorter, PortPositionProcessor, PortSideProcessor, RectilinearEdgeRouter, ReversedEdgeRestorer, SelfLoopProcessor, SortingLayerwiseEdgePlacer, SortingNodewiseEdgePlacer, SplineEdgeRouter, SubgraphOrderingProcessor, ToponumLayerwiseEdgePlacer

public abstract class AbstractAlgorithm
extends Object
implements IAlgorithm

Superclass for algorithms used in the KIELER project. This class stores a reference to the currently used progress monitor.

See Also:
IKielerProgressMonitor
Rating proposed yellow
(2009-12-11) msp

Constructor Summary
AbstractAlgorithm()
           
 
Method Summary
protected  IKielerProgressMonitor getMonitor()
          Returns a progress monitor that can be used by subclasses.
 void reset()
          Removes the associated progress monitor.
 void reset(IKielerProgressMonitor monitor)
          Reset the internal state and set the progress monitor for the algorithm.
 void setProgressMonitor(IKielerProgressMonitor monitor)
          Set the progress monitor for the algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAlgorithm

public AbstractAlgorithm()
Method Detail

reset

public void reset()
Removes the associated progress monitor. Any subclass that overrides this method should call super.reset().

Specified by:
reset in interface IAlgorithm

reset

public final void reset(IKielerProgressMonitor monitor)
Reset the internal state and set the progress monitor for the algorithm.

Specified by:
reset in interface IAlgorithm
Parameters:
monitor - the progress monitor

setProgressMonitor

public final void setProgressMonitor(IKielerProgressMonitor monitor)
Set the progress monitor for the algorithm. Algorithm implementations should make proper use of the monitor by notifying at least the start and end of their task.

Specified by:
setProgressMonitor in interface IAlgorithm
Parameters:
monitor - the progress monitor

getMonitor

protected final IKielerProgressMonitor getMonitor()
Returns a progress monitor that can be used by subclasses. This method does not return null.

Returns:
the associated monitor, or a default implementation if no progress monitor was set