|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
Encapsulates methods common to all graphs (both directed and undirected).
| Field Summary | |
static java.lang.String |
copyright
|
| Method Summary | |
void |
addEdge(int v,
int w)
Adds an unweighted edge to this graph that connects the two vertices specified by their vertex numbers. |
void |
addEdge(int v,
int w,
java.lang.Object weight)
Adds a weighted edge to this graph that connects the two vertices specified by their vertex numbers. |
void |
addVertex(int v)
Adds an unweighted vertex with a specified number to this graph. |
void |
addVertex(int v,
java.lang.Object weight)
Adds a weighted vertex with a specified number to this graph. |
void |
breadthFirstTraversal(Visitor visitor,
int start)
Causes a visitor to visit the vertices of this directed graph in breadth-first traversal order starting from a given vertex. |
void |
depthFirstTraversal(PrePostVisitor visitor,
int start)
Causes a visitor to visit the vertices of this directed graph in depth-first traversal order starting from a given vertex. |
Edge |
getEdge(int v,
int w)
Returns the edge that connects the two vertices specified by their vertex numbers. |
Enumeration |
getEdges()
Returns an enumeration that enumerates the edges in this graph. |
int |
getNumberOfEdges()
Returns the number of edges in this graph. |
int |
getNumberOfVertices()
Returns the number of vertices in this graph. |
Vertex |
getVertex(int v)
Returns the vertex in this graph with the specified number. |
Enumeration |
getVertices()
Returns an enumeration that enumerates the vertices in this graph. |
boolean |
isConnected()
Tests whether this graph is connected. |
boolean |
isCyclic()
Tests whether this graph is cyclic. |
boolean |
isDirected()
Tests whether this graph is a directed graph. |
boolean |
isEdge(int v,
int w)
Tests whether there is an edge in this graph that connects the two vertices specified by their numbers. |
| Methods inherited from interface Opus5.Container |
accept, getCount, getEnumeration, isEmpty, isFull, purge |
| Methods inherited from interface Opus5.Comparable |
compare, isEQ, isGE, isGT, isLE, isLT, isNE |
| Field Detail |
public static final java.lang.String copyright
| Method Detail |
public int getNumberOfEdges()
public int getNumberOfVertices()
public boolean isDirected()
Digraphpublic void addVertex(int v)
v - The number of the vertex to add.ContainerFullException - If no more vertices can be added to this graph.
public void addVertex(int v,
java.lang.Object weight)
v - The number of the vertex to add.weight - The weight to be associated with the vertex.ContainerFullException - If no more vertices can be added to this graph.public Vertex getVertex(int v)
v - The number of the vertex to be returned.Vertex
public void addEdge(int v,
int w)
v - The vertex at the tail of the edge.w - The vertex at the head of the edge.
public void addEdge(int v,
int w,
java.lang.Object weight)
v - The vertex at the tail of the edge.w - The vertex at the head of the edge.weight - The weight to be associated with the edge.
public Edge getEdge(int v,
int w)
v - The vertex at the tail of the edge.w - The vertex at the head of the edge.
public boolean isEdge(int v,
int w)
v - The vertex at the tail of the edge.w - The vertex at the head of the edge.Edgepublic boolean isConnected()
Digraph.isStronglyConnected()public boolean isCyclic()
public Enumeration getVertices()
Enumerationpublic Enumeration getEdges()
Enumeration
public void depthFirstTraversal(PrePostVisitor visitor,
int start)
visitor - The visitor to accept.start - The vertex at which to start the traversal.PrePostVisitor
public void breadthFirstTraversal(Visitor visitor,
int start)
visitor - The visitor to accept.start - The vertex at which to start the traversal.Visitor
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||