|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.bbk.dcs.automed.graph.DirectedGraph
public class DirectedGraph
Class that abstracts a directed unlabelled graph.
Field Summary | |
---|---|
(package private) java.util.List |
graphNodes
|
private java.util.Set |
subGraphs
|
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. |
boolean |
containsGraphNode(DirectedGraphNode n)
|
private TreeNode |
convertToTree(DirectedGraphNode n,
TreeNode parentT)
This method converts a given DirectedGraphNode into a TreeNode, by giving it the same name and assigning to it the same children as the DirectedGraphNode. |
private void |
createSubGraph(DirectedGraph newSubGraph,
DirectedGraphNode currentNode)
|
protected java.util.List |
getGraph()
|
protected DirectedGraphNode |
getNode(int i)
|
DirectedGraphNode |
getNode(java.lang.String name)
|
protected java.util.Set |
getSubGraphs()
|
java.util.Set |
graphToForest(Forest f)
This method first divides a given graph into subGraphs. |
private java.util.List |
graphToTrees(DirectedGraph n,
int treeType)
This method creates a tree from a given graph. |
protected void |
identifySubGraphs()
Discovers the subGraphs in the graph |
protected void |
printGraph(DirectedGraph n)
|
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.util.List graphNodes
private java.util.Set subGraphs
Constructor Detail |
---|
public DirectedGraph()
Method Detail |
---|
public void addGraphNode(DirectedGraphNode n) throws GraphException
n
- the node to add
GraphException
public boolean containsGraphNode(DirectedGraphNode n)
n
- a DirectedGraphNode object
protected java.util.List getGraph()
public int size()
protected DirectedGraphNode getNode(int i)
public DirectedGraphNode getNode(java.lang.String name) throws NotFoundException
NotFoundException
public java.util.Set graphToForest(Forest f) throws GraphException
graph
- the graph
GraphException
private java.util.List graphToTrees(DirectedGraph n, int treeType) throws GraphException
n
- the graphtreeType
- 1 for minimum fan-out (possibly minimum data replication).
GraphException
private TreeNode convertToTree(DirectedGraphNode n, TreeNode parentT)
n
- the graph node
protected java.util.Set getSubGraphs()
protected void addSubGraph(DirectedGraph graph)
graph
- the subGraph to addprotected void identifySubGraphs() throws GraphException
GraphException
private void createSubGraph(DirectedGraph newSubGraph, DirectedGraphNode currentNode) throws GraphException
GraphException
protected void printGraph(DirectedGraph n)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |