|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.lib.graph.Graph
public class Graph
Graph representation using the adjacency list form. See the book 'Introduction to Algorithms' by Cormen, Leiserson, and Rivest.
Constructor Summary | |
---|---|
Graph()
|
Method Summary | |
---|---|
void |
addEdge(Edge edge)
Add an edge to the graph. |
void |
addNode(Object node)
Add a node to the graph. |
void |
clear()
Clear the graph. |
void |
clearTraversal()
Clear all nodes and edges of the bookkeeping information from their last traversal. |
boolean |
containsNode(Object node)
Return true if the graph contains the given node. |
Collection<Edge> |
getEdges()
Return all edges in the graph. |
Collection<Edge> |
getEdges(Object from,
Object to)
Return all the edges from one node to another. |
Collection<Edge> |
getEdgesFrom(Object node)
Return all the edges from a particular node. |
Collection<Edge> |
getEdgesTo(Object node)
Return all the edges to a particular node. |
Collection<Object> |
getNodes()
Return a view of all nodes in the graph. |
boolean |
removeEdge(Edge edge)
Remove an edge from the graph. |
boolean |
removeNode(Object node)
Remove a node from the graph. |
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 clear()
public boolean containsNode(Object node)
public Collection<Object> getNodes()
public void addNode(Object node)
public boolean removeNode(Object node)
public Collection<Edge> getEdges()
public Collection<Edge> getEdgesFrom(Object node)
public Collection<Edge> getEdgesTo(Object node)
public Collection<Edge> getEdges(Object from, Object to)
public void addEdge(Edge edge)
public boolean removeEdge(Edge edge)
public void clearTraversal()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |