|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Defines an interface for a directed graph structure. A graph can contain nodes and edges. Operations on the graph are done using references to the nodes and edges.
org.globus.ogce.util.Graph,
org.globus.ogce.util.GraphEdge,
org.globus.ogce.util.GraphNode| Method Summary | |
Edge |
addEdge(Node fromNode,
Node toNode,
Object contents)
Adds an edge from FromNode to ToNode. |
void |
addGraphListener(GraphListener l)
Adds a listener to listen for structural changes in the graph |
Node |
addNode()
Creates a new node in the graph |
Node |
addNode(Object contents)
Creates a new node storing Contents in it |
void |
clear()
Removes all nodes and edges from this graph |
Object |
clone()
Constructs a shallow copy of this graph. |
int |
edgeCount()
Returns No of edges in the graph |
Edge |
findEdge(Object contents)
|
Node |
findNode(Object contents)
Finds the node that has the specified contents |
EdgeIterator |
getEdgesIterator()
Returns an iterator with the edges in the graph |
Set |
getEdgesSet()
Returns a list with the edges in the graph. |
NodeIterator |
getNodesIterator()
Returns an iterator with all the nodes in the graph |
Set |
getNodesSet()
Returns a list with the nodes in the graph. |
int |
nodeCount()
Returns No of nodes in the graph |
void |
removeEdge(Edge edge)
Removes an edge from the graph. |
void |
removeEdge(Node fromNode,
Node toNode)
Removes an edge going from FromNode to ToNode
If multiple edges exist between the two nodes, multiple calls to this method
should be made, until an EdgeNotFoundException is thrown. |
void |
removeGraphListener(GraphListener l)
Removes a listener |
void |
removeNode(Node node)
Removes the specified node from the graph It will also remove all the edges connected to the node |
| Method Detail |
public Node addNode()
public Node addNode(Object contents)
Contents in it
contents - The object to be added to the Node
public Edge addEdge(Node fromNode,
Node toNode,
Object contents)
throws NodeNotFoundException
FromNode to ToNode.
A NodeNotFoundException is thrown if any of the two nodes does not
exist in this graph.
fromNode - The source node for the edgetoNode - The destination node for the edgecontents - The object to be stored in the edge
NodeNotFoundExceptionpublic int edgeCount()
public int nodeCount()
public NodeIterator getNodesIterator()
public Set getNodesSet()
public EdgeIterator getEdgesIterator()
public Set getEdgesSet()
public Node findNode(Object contents)
public Edge findEdge(Object contents)
public void removeNode(Node node)
throws NodeNotFoundException
node - The node to be removed
NodeNotFoundException - thrown if the node was not found in this graph
public void removeEdge(Node fromNode,
Node toNode)
throws EdgeNotFoundException
FromNode to ToNode
If multiple edges exist between the two nodes, multiple calls to this method
should be made, until an EdgeNotFoundException is thrown.
fromNode - Description of the ParametertoNode - Description of the Parameter
EdgeNotFoundException - this exception is thrown if no edge exists between the two nodes
public void removeEdge(Edge edge)
throws EdgeNotFoundException
edge - The edge to be removed.
EdgeNotFoundException - ... if the specified edge does not exist in this graphpublic void addGraphListener(GraphListener l)
l - the listener to be addedpublic void removeGraphListener(GraphListener l)
l - public void clear()
public Object clone()
Node and
Edge objects will not be the same as in the old graph, but their contents will.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||