|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--graph.AdjListDigraph
A directed graph in which each vertex stores its outgoing edges.
| Constructor Summary | |
AdjListDigraph()
|
|
| Method Summary | |
graph.DirectedEdge |
insertDirectedEdge(graph.Vertex from,
graph.Vertex to,
java.lang.Object element)
Adds a new directed edge from one vertex to another. |
void |
insertReverseOf(graph.DirectedEdge e)
Convenience method: Add the reverse of the given edge, with the same element. |
graph.Vertex |
insertVertex(java.lang.Object element)
Insert and return a new vertex. |
int |
numEdges()
Return the size of the graph (number of edges, m). |
int |
numVertices()
Return the order of the graph (number of vertices, n). |
java.util.Iterator |
outIncidentEdges(graph.Vertex v)
Return an iterator over all the directed edges from a vertex. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AdjListDigraph()
| Method Detail |
public int numVertices()
Digraph
numVertices in interface Digraphpublic int numEdges()
Digraph
numEdges in interface Digraphpublic java.util.Iterator outIncidentEdges(graph.Vertex v)
Digraph
outIncidentEdges in interface Digraphpublic graph.Vertex insertVertex(java.lang.Object element)
Digraph
insertVertex in interface Digraphelement - the element stored at the vertex.
public graph.DirectedEdge insertDirectedEdge(graph.Vertex from,
graph.Vertex to,
java.lang.Object element)
Digraph
insertDirectedEdge in interface Digraphelement - the element stored on the edge.public void insertReverseOf(graph.DirectedEdge e)
Digraph
insertReverseOf(insertDirectedEdge(from, to, element));
This is convenient if from, to, or element is a complicated
expression.
insertReverseOf in interface Digraph
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||