|
datastructures | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface for a graph.
Method Summary | |
boolean |
areAdjacent(Vertex u,
Vertex v)
Test whether two vertices are adjacent |
Iterator |
edges()
Return an iterator over the edges of the graph |
Vertex[] |
endVertices(Edge e)
Return the endvertices of a vertex as an array of length 2 |
Iterator |
incidentEdges(Vertex v)
Return an iterator over the edges incident on a vertex |
Edge |
insertEdge(Vertex u,
Vertex v,
Object o)
Insert and return a new edge with a given element between two vertices |
Vertex |
insertVertex(Object o)
Insert and return a new vertex with a given element |
Vertex |
opposite(Vertex v,
Edge e)
Return the other endvertex of an incident edge |
Object |
removeEdge(Edge e)
Remove an edge and return its element |
Object |
removeVertex(Vertex v)
Remove a vertex and all its incident edges and return the element stored at the removed vertex |
Object |
replace(Position p,
Object o)
Replace the element a given position (vertex or edge) with a new element and return the old element |
Iterator |
vertices()
Return an iterator over the vertices of the graph |
Method Detail |
public Iterator vertices()
public Iterator edges()
public Object replace(Position p, Object o) throws InvalidPositionException
InvalidPositionException
public Iterator incidentEdges(Vertex v) throws InvalidPositionException
InvalidPositionException
public Vertex[] endVertices(Edge e) throws InvalidPositionException
InvalidPositionException
public Vertex opposite(Vertex v, Edge e) throws InvalidPositionException
InvalidPositionException
public boolean areAdjacent(Vertex u, Vertex v) throws InvalidPositionException
InvalidPositionException
public Vertex insertVertex(Object o)
public Edge insertEdge(Vertex u, Vertex v, Object o) throws InvalidPositionException
InvalidPositionException
public Object removeVertex(Vertex v) throws InvalidPositionException
InvalidPositionException
public Object removeEdge(Edge e) throws InvalidPositionException
InvalidPositionException
|
datastructures | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |