uk.ac.bbk.dcs.automed.graph
Class DirectedGraph

java.lang.Object
  |
  +--uk.ac.bbk.dcs.automed.graph.DirectedGraph

public class DirectedGraph
extends java.lang.Object

Class that abstracts a directed unlabelled graph.

Author:
Lucas Zamboulis

Constructor Summary
DirectedGraph()
           
 
Method Summary
 void addGraphNode(DirectedGraphNode n)
          Adds a node in the graph.
protected  void addSubGraph(DirectedGraph graph)
          Adds a subGraph in the set of subGraphs.
protected  java.util.LinkedList getGraph()
           
protected  DirectedGraphNode getNode(int i)
           
 DirectedGraphNode getNode(java.lang.String name)
           
protected  java.util.HashSet getSubGraphs()
           
protected  void identifySubGraphs()
          Discovers the subGraphs in the graph
protected  void printGraph(DirectedGraph n)
           
 int size()
           
 java.util.HashSet toForest(Forest f)
          This method first divides a given graph into subGraphs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectedGraph

public DirectedGraph()
Method Detail

addGraphNode

public void addGraphNode(DirectedGraphNode n)
Adds a node in the graph.

Parameters:
n - the node to add

getGraph

protected java.util.LinkedList getGraph()
Returns:
the nodes consisting the graph

size

public int size()
Returns:
the number of nodes consisting the graph

getNode

protected DirectedGraphNode getNode(int i)

getNode

public DirectedGraphNode getNode(java.lang.String name)
                          throws NotFoundException
NotFoundException

toForest

public java.util.HashSet toForest(Forest f)
This method first divides a given graph into subGraphs. Then it converts each one to a tree, effectively transforming a graph into a forest

Returns:
the forest

getSubGraphs

protected java.util.HashSet getSubGraphs()
Returns:
the subGraphs of the graph

addSubGraph

protected void addSubGraph(DirectedGraph graph)
Adds a subGraph in the set of subGraphs.

Parameters:
graph - the subGraph to add

identifySubGraphs

protected void identifySubGraphs()
Discovers the subGraphs in the graph


printGraph

protected void printGraph(DirectedGraph n)