de.fhstralsund.vinets.algorithm
Class ConnectivityCheck

java.lang.Object
  extended by de.fhstralsund.vinets.algorithm.ConnectivityCheck
All Implemented Interfaces:
Algorithm

public class ConnectivityCheck
extends java.lang.Object
implements Algorithm

Checks graph connectivity. Firstly, it is checked whether the graph is connected. Then, every connected component discovered is checked for biconnectivity. Thus the whole graph is biconnected if both tests result true.


Constructor Summary
ConnectivityCheck()
          Creates a new ConnectivityCheck.
 
Method Summary
 boolean accept(Parameter params)
          Checks whether the passed Parameter is appropriate as input for this Algorithm.
 java.util.Iterator cutVertices()
          Returns an Iterator over the cut vertices that have been discovered if not all connected components are biconnected.
 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.
 boolean isBiConnected()
          Returns whether the connected components of the graph are biconnected.
 boolean isConnected()
          Returns whether the graph is connected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectivityCheck

public ConnectivityCheck()
Creates a new ConnectivityCheck.

Method Detail

accept

public boolean accept(Parameter params)
Description copied from interface: Algorithm
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.

Specified by:
accept in interface Algorithm
Parameters:
params - a Parameter object containing the input Graph and possible additional input values.
Returns:
true if this Parameter is a feasible input.

getHint

public java.lang.String getHint()
Description copied from interface: Algorithm
Delivers a short help text explaining the features of this Algorithm.

Specified by:
getHint in interface Algorithm
Returns:
the hint.

getName

public java.lang.String getName()
Description copied from interface: Algorithm
Delivers a text for the button linked to this Algorithm.

Specified by:
getName in interface Algorithm
Returns:
the button text.

execute

public Parameter execute(Parameter params)
Description copied from interface: Algorithm
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.

Specified by:
execute in interface Algorithm
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

isConnected

public boolean isConnected()
Returns whether the graph is connected. Should be called AFTER algorithm execution.

Returns:
true if the graph is connected, false otherwise.

isBiConnected

public boolean isBiConnected()
Returns whether the connected components of the graph are biconnected. The whole graph is biconnected if it is also connected. Should be called AFTER algorithm execution.

Returns:
True if the connected components are bconnected, false otherwise
See Also:
isConnected

cutVertices

public java.util.Iterator cutVertices()
Returns an Iterator over the cut vertices that have been discovered if not all connected components are biconnected. Should be called AFTER algorithm execution.

Returns:
an Iterator over the cut vertices.