|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.globus.cog.util.graph.Graph
public class Graph
Implements the graph interface
org.globus.ogce.util.Graph
,
org.globus.ogce.util.GraphEdge
,
org.globus.ogce.util.GraphNode
Constructor Summary | |
---|---|
Graph()
Constructs a new Graph object without any nodes or edges |
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()
Returns a shallow copy of the graph. |
int |
edgeCount()
Returns No of edges in the graph |
boolean |
equals(Object o)
Determines if the specified graph is structurally equivalen to the specified 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 |
hashCode()
|
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 |
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 |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Graph()
Graph
object without any nodes or edges
Method Detail |
---|
public void addGraphListener(GraphListener l)
GraphInterface
addGraphListener
in interface GraphInterface
l
- the listener to be addedpublic void removeGraphListener(GraphListener l)
GraphInterface
removeGraphListener
in interface GraphInterface
public void clear()
GraphInterface
clear
in interface GraphInterface
public Node addNode()
addNode
in interface GraphInterface
public Node addNode(Object Contents)
Contents
in it
addNode
in interface GraphInterface
Contents
- The feature to be added to the Node attribute
public Edge addEdge(Node FromNode, Node ToNode, Object contents) throws NodeNotFoundException
FromNode
to ToNode
addEdge
in interface GraphInterface
FromNode
- the node the edge starts fromToNode
- the node the edge goes tocontents
- The object to be stored in the edge
NodeNotFoundException
- If one of the specified nodes is not foundpublic int edgeCount()
edgeCount
in interface GraphInterface
public int nodeCount()
nodeCount
in interface GraphInterface
public NodeIterator getNodesIterator()
getNodesIterator
in interface GraphInterface
public Set getNodesSet()
GraphInterface
getNodesSet
in interface GraphInterface
public EdgeIterator getEdgesIterator()
getEdgesIterator
in interface GraphInterface
public Set getEdgesSet()
GraphInterface
getEdgesSet
in interface GraphInterface
public void removeNode(Node node) throws NodeNotFoundException
removeNode
in interface GraphInterface
node
- Description of the Parameter
NodeNotFoundException
- thrown if the node was not found in this graphpublic void removeEdge(Node fromNode, Node toNode) throws NodeNotFoundException, EdgeNotFoundException
FromNode
to ToNode
removeEdge
in interface GraphInterface
fromNode
- Description of the ParametertoNode
- Description of the Parameter
NodeNotFoundException
- Description of the Exception
EdgeNotFoundException
- Description of the Exceptionpublic void removeEdge(Edge edge) throws EdgeNotFoundException
removeEdge
in interface GraphInterface
edge
- Description of the Parameter
EdgeNotFoundException
- Description of the Exceptionpublic Edge findEdge(Object contents)
findEdge
in interface GraphInterface
public Node findNode(Object contents)
GraphInterface
findNode
in interface GraphInterface
public Object clone()
clone
in interface GraphInterface
clone
in class Object
public boolean equals(Object o)
equals
in class Object
o
- The object to be compared to this graph
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |