|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Graph<V,E>
This interface represents a graph. It provides operations for building the graph, graph traverals and for marking/unmarking vertices. There are two nested interfaces representing vertices and edges in the graph.
| Nested Class Summary | |
|---|---|
static interface |
Graph.Edge<V,E>
Represents an edge in a graph. |
static interface |
Graph.Vertex<V,E>
Represents a vertex in a graph. |
| Method Summary | |
|---|---|
void |
addEdge(E value,
Graph.Vertex<V,E> source,
Graph.Vertex<V,E> destination)
Inserts a new directed edge in this graph. |
Graph.Vertex<V,E> |
addVertex(V value)
Inserts a new vertex in the graph. |
void |
unvisit()
Marks all vertices of this graph as not visited. |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Method Detail |
|---|
Graph.Vertex<V,E> addVertex(V value)
value - The value associated with the newly inserted vertex.
void addEdge(E value,
Graph.Vertex<V,E> source,
Graph.Vertex<V,E> destination)
value - The value associated with the newly created edge.source - The source vertex of the newly created edge.destination - The destination vertex of the newly created Edge.
NoSuchElementException - if source or destination is not present in this graph.void unvisit()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||