|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectbaseCode.dataStructure.graph.AbstractGraph
baseCode.dataStructure.graph.DirectedGraph
A graph that contains DirectedGraphNodes. It can be cyclic. Small unconnected parts of the graph will be ignored for many operation. Tree traversals start from the root node, which is defined as the node with the most children.
Copyright (c) Columbia University
| Field Summary |
| Fields inherited from class baseCode.dataStructure.graph.AbstractGraph |
items |
| Constructor Summary | |
DirectedGraph()
|
|
DirectedGraph(java.util.Set nodes)
|
|
| Method Summary | |
void |
addChildTo(java.lang.Object key,
java.lang.Object newChildKey)
Add a child to a particular node identified by key; if the node is not in the graph, an exception is thrown. |
void |
addChildTo(java.lang.Object key,
java.lang.Object newChildKey,
java.lang.Object newChild)
Add a child to a particualar node identified by key. |
void |
addNode(java.lang.Object key,
java.lang.Object item)
|
void |
addParentTo(java.lang.Object key,
java.lang.Object newParentKey)
|
void |
addParentTo(java.lang.Object key,
java.lang.Object newParentKey,
java.lang.Object newParent)
|
void |
prune()
Remove vertices to nodes that aren't in the graph. |
void |
topoSort()
Fills in the topoSortOrder for each node. |
java.lang.String |
toString()
Shows the tree as a tabbed list. |
javax.swing.JTree |
treeView()
Generate a JTree corresponding to this graph. |
| Methods inherited from class baseCode.dataStructure.graph.AbstractGraph |
addNode, containsKey, get, getItems, getNodeContents, unmarkAll |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DirectedGraph()
public DirectedGraph(java.util.Set nodes)
nodes - Set of DirectedGraphNodes| Method Detail |
public void addNode(java.lang.Object key,
java.lang.Object item)
key - Objectitem - Object
public void addChildTo(java.lang.Object key,
java.lang.Object newChildKey,
java.lang.Object newChild)
key - ObjectnewChildKey - ObjectnewChild - Object
public void addChildTo(java.lang.Object key,
java.lang.Object newChildKey)
throws java.lang.IllegalStateException
key - ObjectnewChildKey - Object
java.lang.IllegalStateException - if the graph doesn't contain the child node.
public void addParentTo(java.lang.Object key,
java.lang.Object newParentKey,
java.lang.Object newParent)
key - ObjectnewParentKey - ObjectnewParent - Object
public void addParentTo(java.lang.Object key,
java.lang.Object newParentKey)
throws java.lang.IllegalStateException
key - ObjectnewParentKey - Object
java.lang.IllegalStateExceptionpublic java.lang.String toString()
public void prune()
public void topoSort()
public javax.swing.JTree treeView()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||