quoggles.algorithms.qbfs
Class QPreNodesAlgorithm

java.lang.Object
  |
  +--org.graffiti.plugin.algorithm.AbstractAlgorithm
        |
        +--quoggles.algorithms.qbfs.QPreNodesAlgorithm
All Implemented Interfaces:
org.graffiti.plugin.algorithm.Algorithm

public class QPreNodesAlgorithm
extends org.graffiti.plugin.algorithm.AbstractAlgorithm

A BFS on directed graphs in reverse direction. Especially used to find all sources that lead to a specified Node.

Version:
$Revision: 1.1 $

Field Summary
private  java.util.ArrayList preNodesList
          List (sorted according to BFS number) of nodes from which a path to the sourceNode exists.
private  java.util.ArrayList preSourceNodes
          Nodes without incoming edges that are in the preNodesList
private  org.graffiti.graph.Node sourceNode
          Start node
 
Fields inherited from class org.graffiti.plugin.algorithm.AbstractAlgorithm
graph, parameters
 
Constructor Summary
QPreNodesAlgorithm()
           
 
Method Summary
 void check()
           
 void execute()
           
 java.lang.String getName()
           
 org.graffiti.plugin.parameter.Parameter[] getParameters()
           
 java.util.ArrayList getPreNodesList()
          Returns the List (sorted according to BFS number) of nodes from which a path to the sourceNode exists.
 java.util.ArrayList getPreSourceNodes()
          Returns a List of nodes without incoming edges that are in the preNodesList.
 void setParameters(org.graffiti.plugin.parameter.Parameter[] params)
           
 
Methods inherited from class org.graffiti.plugin.algorithm.AbstractAlgorithm
attach, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sourceNode

private org.graffiti.graph.Node sourceNode
Start node


preNodesList

private java.util.ArrayList preNodesList
List (sorted according to BFS number) of nodes from which a path to the sourceNode exists.


preSourceNodes

private java.util.ArrayList preSourceNodes
Nodes without incoming edges that are in the preNodesList

Constructor Detail

QPreNodesAlgorithm

public QPreNodesAlgorithm()
Method Detail

getPreNodesList

public java.util.ArrayList getPreNodesList()
Returns the List (sorted according to BFS number) of nodes from which a path to the sourceNode exists.

Returns:

getPreSourceNodes

public java.util.ArrayList getPreSourceNodes()
Returns a List of nodes without incoming edges that are in the preNodesList.

Returns:

getName

public java.lang.String getName()
See Also:
Algorithm.getName()

setParameters

public void setParameters(org.graffiti.plugin.parameter.Parameter[] params)
Specified by:
setParameters in interface org.graffiti.plugin.algorithm.Algorithm
Overrides:
setParameters in class org.graffiti.plugin.algorithm.AbstractAlgorithm
See Also:
setParameters(org.graffiti.plugin.algorithm.Parameter)

getParameters

public org.graffiti.plugin.parameter.Parameter[] getParameters()
Specified by:
getParameters in interface org.graffiti.plugin.algorithm.Algorithm
Overrides:
getParameters in class org.graffiti.plugin.algorithm.AbstractAlgorithm
See Also:
Algorithm.getParameters()

check

public void check()
           throws org.graffiti.plugin.algorithm.PreconditionException
Specified by:
check in interface org.graffiti.plugin.algorithm.Algorithm
Overrides:
check in class org.graffiti.plugin.algorithm.AbstractAlgorithm
org.graffiti.plugin.algorithm.PreconditionException
See Also:
Algorithm.check()

execute

public void execute()
See Also:
org.graffiti.plugin.algorithm.Algorithm#execute(Graph)