|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ir.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()
Returns the next node in an iterator over the nodes of 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 graph from file where each line consists of a node-name followed by a list of the names of nodes to which it points |
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.IOException
public 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 |