org.graffiti.plugin.algorithm
Class AbstractAlgorithm

java.lang.Object
  extended by org.graffiti.plugin.AbstractParametrizable
      extended by org.graffiti.plugin.algorithm.AbstractAlgorithm
All Implemented Interfaces:
Algorithm, Parametrizable

public abstract class AbstractAlgorithm
extends AbstractParametrizable
implements Algorithm

Implements some empty versions of non-obligatory methods.


Constructor Summary
AbstractAlgorithm()
           
 
Method Summary
 void attach(Graph g)
          Attaches the given graph to this algorithm.
 void check()
          Checks whether all preconditions of the current graph are satisfied.
 Animation getAnimation()
          Returns an animation for this algorithm if it supports animation.
 void reset()
          Resets the internal state of the algorithm.
 boolean supportsAnimation()
          Returns true if this algorithm supports animation; i.e.
 
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
execute
 
Methods inherited from interface org.graffiti.plugin.Parametrizable
getDefaultParameters, getName, getParameters, setParameters
 

Constructor Detail

AbstractAlgorithm

public AbstractAlgorithm()
Method Detail

attach

public void attach(Graph g)
Description copied from interface: Algorithm
Attaches the given graph to this algorithm.

Specified by:
attach in interface Algorithm
Parameters:
g - the graph to attach.
See Also:
Algorithm.attach(org.graffiti.graph.Graph)

check

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

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

reset

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

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

supportsAnimation

public boolean supportsAnimation()
Returns true if this algorithm supports animation; i.e. getAnimation will not throw an UnsupportedOperationException.

This implementation always returns false.

Specified by:
supportsAnimation in interface Algorithm
Returns:
true if this algorithm supports animation.
See Also:
getAnimation()

getAnimation

public Animation getAnimation()
Returns an animation for this algorithm if it supports animation. An algorithm supports animation if supportsAnimation returns true. Throws UnsupportedOperationException otherwise.

This implementation always throws UnsupportedOperationException.

Specified by:
getAnimation in interface Algorithm
Returns:
an animation for this algorithm.
Throws:
UnsupportedOperationException - if this algorithm does not support animation.
See Also:
supportsAnimation()


Generated at 2012-05-30 11:00:14 PM CEST