|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectir.webutils.Graph
public class Graph
Graph data structure.
| Constructor Summary | |
|---|---|
Graph()
Basic constructor. |
|
| Method Summary | |
|---|---|
void |
addEdge(java.lang.String xName,
java.lang.String yName)
Adds an edge from xName to yName. |
boolean |
addNode(java.lang.String name)
Adds a node if it is not already present. |
Node |
getExistingNode(java.lang.String name)
Returns the node with that name |
Node |
getNode(java.lang.String name)
Returns the node with that name, creates one if not already present. |
static void |
main(java.lang.String[] args)
|
Node |
nextNode()
Helps in iterating through all the nodes in the graph. |
Node[] |
nodeArray()
Returns all the nodes of the graph. |
void |
print()
Prints the entire graph on stdout. |
void |
readFromFile(java.lang.String fileName)
Reads from file |
void |
resetIterator()
Resets the iterator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Graph()
| Method Detail |
|---|
public void addEdge(java.lang.String xName,
java.lang.String yName)
public boolean addNode(java.lang.String name)
public Node getNode(java.lang.String name)
public void readFromFile(java.lang.String fileName)
throws java.io.IOException
java.io.IOExceptionpublic Node getExistingNode(java.lang.String name)
public void resetIterator()
public Node nextNode()
public void print()
public Node[] nodeArray()
public static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||