|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AdjacencyMatrixGraph
Field Summary | |
---|---|
static int |
MAX_VERTICES
|
Method Summary | |
---|---|
boolean |
areAdjacent(CS16Vertex v1,
CS16Vertex v2)
Returns true if there exists an Edge that connects Vertex v1 and Vertex v2. |
void |
clear()
Clears all the vertics and edges from the graph. |
CS16Edge |
connectingEdge(CS16Vertex v1,
CS16Vertex v2)
Returns the edge that connects the two vertices. |
java.util.Iterator<CS16Edge> |
edges()
Returns an iterator holding all the Edge's of the graph. |
CS16Vertex[] |
endVertices(CS16Edge e)
Returns the two Vertex's that the Edge e is incident upon. |
java.util.Iterator<CS16Edge> |
incidentEdges(CS16Vertex v)
Returns an EdgeIterator over all the Edge's that are connected to this Vertex. |
CS16Edge |
insertEdge(CS16Vertex v1,
CS16Vertex v2,
java.lang.Object edgeElement)
Inserts a new Edge into your Graph. |
CS16Vertex |
insertVertex(java.lang.Object vertElement)
Inserts a new Vertex into your Graph. |
CS16Vertex |
opposite(CS16Vertex v,
CS16Edge e)
Returns the Vertex that is on the other side of Edge e opposite of Vertex v. |
java.lang.Object |
removeEdge(CS16Edge e)
Removes an Edge from your Graph. |
java.lang.Object |
removeVertex(CS16Vertex v)
Removes a Vertex from your graph. |
java.util.Iterator<CS16Vertex> |
vertices()
Returns an iterator holding all the Vertex's of the graph. |
Field Detail |
---|
static final int MAX_VERTICES
Method Detail |
---|
CS16Vertex insertVertex(java.lang.Object vertElement)
vertElement
- The element of the inserted Vertex.
CS16Edge insertEdge(CS16Vertex v1, CS16Vertex v2, java.lang.Object edgeElement)
v1
- The first vertex of the edge connection.v2
- The second vertex of the edge connection.edgeElement
- The element of the newly inserted edge.
InvalidVertexException
- Thrown when the Vertex is not valid.java.lang.Object removeVertex(CS16Vertex v) throws InvalidVertexException
v
- The Vertex to remove.
InvalidVertexException
- Thrown when the Vertex is not valid.java.lang.Object removeEdge(CS16Edge e) throws InvalidEdgeException
e
- The Edge to remove.
InvalidEdgeException
- Thrown when the Edge is not valid.CS16Edge connectingEdge(CS16Vertex v1, CS16Vertex v2) throws InvalidVertexException, NoSuchEdgeException
v1
- The first vertex that may be connected.v2
- The second vertex that may be connected.
InvalidVertexException
- Thrown when either vertex is invalid.
NoSuchEdgeException
- Thrown when no edge connects the vertices.java.util.Iterator<CS16Edge> incidentEdges(CS16Vertex v) throws InvalidVertexException
v
- The vertex to find the incident edges on.
InvalidVertexException
- Thrown when the Vertex is not valid.jdsl.graph.ref.EdgeIteratorAdapter
,
jdsl.core.api.ObjectIterator
,
jdsl.core.ref.ArrayObjectIterator
CS16Vertex opposite(CS16Vertex v, CS16Edge e) throws InvalidVertexException, InvalidEdgeException, NoSuchVertexException
v
- The first vertex on Edge e.e
- The edge connecting Vertex v and the uknown opposite Vertex.
InvalidVertexException
- Thrown when the Vertex is not valid.
InvalidEdgeException
- Thrown when the Edge is not valid.
NoSuchVertexException
- Thrown when Edge e is not incident on v.CS16Vertex[] endVertices(CS16Edge e) throws InvalidEdgeException
e
- The edge to find the connecting Vertex's on.
InvalidEdgeException
- Thrown when the Edge e is not valid.boolean areAdjacent(CS16Vertex v1, CS16Vertex v2) throws InvalidVertexException
v1
- The first Vertex to test adjacency.v2
- The second Vertex to test adjacency.
InvalidVertexException
- Thrown if either vertex is invalid.java.util.Iterator<CS16Edge> edges()
This must run in O(m) time.
java.util.Iterator<CS16Vertex> vertices()
This must run in O(n) time.
void clear()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |