|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Common interface for all graph objects.
| Method Summary | |
GraphEdge |
addEdge(java.lang.Object data,
GraphNode origin,
GraphNode destination)
Adds an edge to this graph. |
GraphNode |
addNode(java.lang.Object data)
Adds a node to this graph. |
GraphNode[] |
getAdjacentNodes(GraphNode v)
Retrieves all nodes directly adjacent to the given node. |
java.lang.Object |
getData(GraphEdge e)
Returns the data stored inside a given edge. |
java.lang.Object |
getData(GraphNode v)
Returns the data stored inside a given node. |
GraphEdge[] |
getEdges(GraphNode v)
Retrieves all edges outgoing from a given node. |
GraphNode[] |
getNodes()
Retrieves all nodes in this graph. |
GraphNode[] |
getNodes(GraphEdge e)
Retrieves the two nodes connected by a given edge. |
void |
setData(GraphEdge e,
java.lang.Object data)
Sets the data for a given edge. |
void |
setData(GraphNode v,
java.lang.Object data)
Sets the data for a given node. |
| Method Detail |
public GraphEdge[] getEdges(GraphNode v)
v - the node for which to retrieve the edges.
public GraphNode[] getNodes(GraphEdge e)
e - the edge for which to retrieve the nodes.
public GraphNode addNode(java.lang.Object data)
data - the data to store in the new node.
public GraphEdge addEdge(java.lang.Object data,
GraphNode origin,
GraphNode destination)
data - the data to store in the new edge.origin - the origin node of this edge.destination - the destination node of this edge.
public GraphNode[] getNodes()
public java.lang.Object getData(GraphNode v)
v - the node from which to retrieve data.
public java.lang.Object getData(GraphEdge e)
e - the edge from which to retrieve data.
public void setData(GraphNode v,
java.lang.Object data)
v - the node for which to set the data.data - the data to store inside the given node.
public void setData(GraphEdge e,
java.lang.Object data)
e - the edge for which to set the data.data - the data to store inside the given edge.public GraphNode[] getAdjacentNodes(GraphNode v)
v - the node for which to retrieve adjacent nodes.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||