org.graffiti.plugins.algorithms.springembedderrestricted
Class UnDirDijkstraAlgorithm

java.lang.Object
  extended by org.graffiti.plugin.AbstractParametrizable
      extended by org.graffiti.plugin.algorithm.AbstractAlgorithm
          extended by org.graffiti.plugins.algorithms.springembedderrestricted.UnDirDijkstraAlgorithm
All Implemented Interfaces:
Algorithm, CalculatingAlgorithm, Parametrizable

public class UnDirDijkstraAlgorithm
extends AbstractAlgorithm
implements CalculatingAlgorithm

An implementation of the dijkstra algorithm. Preconditions:

Either use the method setSourceNode to define the start node of the algorithm or define an appropriate regular expression in the source parameter, which matches the label of a node in the given graph.

Version:
$Revision: 5766 $

Constructor Summary
UnDirDijkstraAlgorithm()
          Constructs a new instance.
 
Method Summary
 void check()
          Checks whether all preconditions of the current graph are satisfied.
 void execute()
          Executes the whole algorithm.
 Parameter<?>[] getAlgorithmParameters()
           
 String getName()
          Returns the name (id) of this Parametrizable.
 AlgorithmResult getResult()
          Returns the AlgorithmResult that was computed by the Algorithm during the last execution.
 Map<Node,PQEntry> getWeightsMap()
          Get the result map in a type safe way.
 void reset()
          Resets the internal state of the algorithm.
 void setAlgorithmParameters(Parameter<?>[] params)
           
 void setOnlyResult(boolean onlyResult)
          Sets the selection on which the algorithm works.
 void setSelection(Selection selection)
          Sets the selection on which the algorithm works.
 void setSourceNode(Node n)
          Sets the source node to the given value.
 
Methods inherited from class org.graffiti.plugin.algorithm.AbstractAlgorithm
attach, getAnimation, supportsAnimation
 
Methods inherited from class org.graffiti.plugin.AbstractParametrizable
copyParameters, getDefaultParameters, getParameters, getUserParameters, saveUserParameters, saveUserParameters, setParameters
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.graffiti.plugin.algorithm.Algorithm
attach, getAnimation, supportsAnimation
 
Methods inherited from interface org.graffiti.plugin.Parametrizable
getDefaultParameters, getParameters, setParameters
 

Constructor Detail

UnDirDijkstraAlgorithm

public UnDirDijkstraAlgorithm()
Constructs a new instance.

Method Detail

getName

public String getName()
Description copied from interface: org.graffiti.plugin.Parametrizable
Returns the name (id) of this Parametrizable.

Specified by:
getName in interface Parametrizable
Returns:
DOCUMENT ME!
See Also:
Parametrizable.getName()

setOnlyResult

public void setOnlyResult(boolean onlyResult)
Sets the selection on which the algorithm works.

Parameters:
onlyResult - the selection

setAlgorithmParameters

public void setAlgorithmParameters(Parameter<?>[] params)
Overrides:
setAlgorithmParameters in class AbstractParametrizable
See Also:
AbstractParametrizable.setAlgorithmParameters(Parameter[])

getAlgorithmParameters

public Parameter<?>[] getAlgorithmParameters()
Overrides:
getAlgorithmParameters in class AbstractParametrizable
See Also:
AbstractParametrizable.getAlgorithmParameters()

getResult

public AlgorithmResult getResult()
Description copied from interface: org.graffiti.plugin.algorithm.CalculatingAlgorithm
Returns the AlgorithmResult that was computed by the Algorithm during the last execution. If there was no previous execution it returns null.

Specified by:
getResult in interface CalculatingAlgorithm
Returns:
the AlgorithmResult computed in the previous execution of the Algorithm.
See Also:
CalculatingAlgorithm.getResult()

getWeightsMap

public Map<Node,PQEntry> getWeightsMap()
Get the result map in a type safe way. Only useful after calling execute.

Returns:
Result of calcuation.

setSelection

public void setSelection(Selection selection)
Sets the selection on which the algorithm works.

Parameters:
selection - the selection

setSourceNode

public void setSourceNode(Node n)
Sets the source node to the given value.

Parameters:
n - the new source node.

check

public void check()
           throws PreconditionException
Description copied from interface: org.graffiti.plugin.algorithm.Algorithm
Checks whether all preconditions of the current graph are satisfied.

Specified by:
check in interface Algorithm
Overrides:
check in class AbstractAlgorithm
Throws:
PreconditionException - if the preconditions of the current graph are not satisfied.
See Also:
Algorithm.check()

execute

public void execute()
Description copied from interface: org.graffiti.plugin.algorithm.Algorithm
Executes the whole algorithm.

Specified by:
execute in interface Algorithm
See Also:
Algorithm.execute()

reset

public void reset()
Description copied from interface: org.graffiti.plugin.algorithm.Algorithm
Resets the internal state of the algorithm.

Specified by:
reset in interface Algorithm
Overrides:
reset in class AbstractAlgorithm
See Also:
Algorithm.reset()


Generated at 2012-05-30 11:01:25 PM CEST