de.cau.cs.kieler.klodd.hierarchical.structures.slimgraph.alg
Class AbstractCycleRemover

java.lang.Object
  extended by de.cau.cs.kieler.core.alg.AbstractAlgorithm
      extended by de.cau.cs.kieler.klodd.hierarchical.structures.slimgraph.alg.AbstractCycleRemover
All Implemented Interfaces:
IAlgorithm, ICycleRemover
Direct Known Subclasses:
DFSCycleRemover, GreedyCycleRemover, InteractiveCycleRemover

public abstract class AbstractCycleRemover
extends AbstractAlgorithm
implements ICycleRemover

Abstract superclass that can be used for implementations of cycle remover algorithms which operate by reversing edges.

Rating proposed yellow
(2009-12-11) msp

Field Summary
 
Fields inherited from interface de.cau.cs.kieler.klodd.hierarchical.structures.slimgraph.alg.ICycleRemover
REVERSED
 
Constructor Summary
AbstractCycleRemover()
           
 
Method Summary
 List<KSlimEdge> getReversedEdges()
          Returns the list of edges that were reversed for cycle removal.
 void reset()
          Removes the associated progress monitor.
 void restoreGraph()
          Restore the original graph after cycles have been removed.
protected  void reverseEdges()
          Switches the source and target of all edges marked in the reversedEdges list.
protected  void setReversedEdges(LinkedList<KSlimEdge> thereversedEdges)
          Sets the reversed edges.
 
Methods inherited from class de.cau.cs.kieler.core.alg.AbstractAlgorithm
getMonitor, reset, setProgressMonitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.cau.cs.kieler.klodd.hierarchical.structures.slimgraph.alg.ICycleRemover
removeCycles
 
Methods inherited from interface de.cau.cs.kieler.core.alg.IAlgorithm
reset, setProgressMonitor
 

Constructor Detail

AbstractCycleRemover

public AbstractCycleRemover()
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
Overrides:
reset in class AbstractAlgorithm

restoreGraph

public void restoreGraph()
Restore the original graph after cycles have been removed.

Specified by:
restoreGraph in interface ICycleRemover

getReversedEdges

public List<KSlimEdge> getReversedEdges()
Returns the list of edges that were reversed for cycle removal.

Specified by:
getReversedEdges in interface ICycleRemover
Returns:
list of reversed edges

setReversedEdges

protected void setReversedEdges(LinkedList<KSlimEdge> thereversedEdges)
Sets the reversed edges.

Parameters:
thereversedEdges - the reversed edges

reverseEdges

protected void reverseEdges()
Switches the source and target of all edges marked in the reversedEdges list.