de.fhstralsund.vinets.algorithm
Interface Algorithm

All Known Implementing Classes:
ConnectivityCheck, LargeCycleFinder

public interface Algorithm

An Algorithm can examine and manipulate the current Graph. The interface Algorithm should be implemented by a class in order to be able to analyse the Graph shown by the GraphApplication. Moreover, it is implemented by all existing layout algorithms.

See Also:
de.fhstralsund.vinets.control.GraphApplication

Method Summary
 boolean accept(Parameter params)
          Checks whether the passed Parameter is appropriate as input for this Algorithm.
 Parameter execute(Parameter params)
          Examines the Graph passed within the Parameter object.
 java.lang.String getHint()
          Delivers a short help text explaining the features of this Algorithm.
 java.lang.String getName()
          Delivers a text for the button linked to this Algorithm.
 

Method Detail

accept

boolean accept(Parameter params)
Checks whether the passed Parameter is appropriate as input for this Algorithm. Usually, implementations check the graph type for applicability of this Algorithm. If the Parameter is rejected and false is returned, the Parameter message should be set to a String describing the cause for the failing.

Parameters:
params - a Parameter object containing the input Graph and possible additional input values.
Returns:
true if this Parameter is a feasible input.

execute

Parameter execute(Parameter params)
Examines the Graph passed within the Parameter object. An implementing method may determine a certain graph property or change the structure, geometry or representation of the Graph and/or its elements. Please notice, that any Algorithm may be invoked multiple times, therefore the required initialization should be called at the beginning of this method.

Parameters:
params - a Parameter encapsulating a Graph and (optionally) a String and additional properties.
Returns:
a Parameter encapsulating the manipulated graph and (optionally) a result String and additional properties.
See Also:
Parameter

getName

java.lang.String getName()
Delivers a text for the button linked to this Algorithm.

Returns:
the button text.

getHint

java.lang.String getHint()
Delivers a short help text explaining the features of this Algorithm.

Returns:
the hint.