|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
An interface describing a combinatorial graph. Directed and
undirected edges may coexist. Multiple parallel edges and
self-loops are allowed. The graph can be disconnected.
Note that the Vertex and Edge interfaces,
which are subinterfaces of jdsl.core.api.Position, are
empty interfaces, for type safety only.
Vertex,
Edge,
ModifiableGraph| Method Summary | |
Edge |
attachVertex(Vertex v,
Object vertexElement,
Object edgeElement)
Attaches a new vertex, containing an object, to an existing vertex by inserting a new undirected edge. |
Edge |
attachVertexFrom(Vertex origin,
Object vertexElement,
Object edgeElement)
Attaches a new vertex, containing an object, by inserting a new directed edge from an existing vertex. |
Edge |
attachVertexTo(Vertex destination,
Object vertexElement,
Object edgeElement)
Attaches a new vertex, containing an object, by inserting a new directed edge to an existing vertex. |
Edge |
insertDirectedEdge(Vertex v1,
Vertex v2,
Object element)
Inserts a new directed edge from an existing vertex to another. |
Edge |
insertEdge(Vertex v1,
Vertex v2,
Object element)
Inserts a new undirected edge between two existing vertices. |
Vertex |
insertVertex(Object element)
Inserts a new isolated vertex. |
Object |
removeEdge(Edge e)
|
Object |
removeVertex(Vertex v)
Removes a vertex and all its incident edges. |
| Methods inherited from interface jdsl.graph.api.ModifiableGraph |
makeUndirected, reverseDirection, setDirectionFrom, setDirectionTo, splitEdge, unsplitEdge |
| Methods inherited from interface jdsl.graph.api.InspectableGraph |
aCommonVertex, aConnectingEdge, adjacentVertices, adjacentVertices, anEdge, anIncidentEdge, anIncidentEdge, areAdjacent, areAdjacent, areIncident, aVertex, connectingEdges, degree, degree, destination, directedEdges, edges, endVertices, incidentEdges, incidentEdges, isDirected, numEdges, numVertices, opposite, origin, undirectedEdges, vertices |
| Methods inherited from interface jdsl.core.api.InspectablePositionalContainer |
positions |
| Methods inherited from interface jdsl.core.api.InspectableContainer |
contains, elements, isEmpty, size |
| Methods inherited from interface jdsl.core.api.PositionalContainer |
swapElements |
| Methods inherited from interface jdsl.core.api.Container |
newContainer, replaceElement |
| Method Detail |
public Vertex insertVertex(Object element)
element - the object to be stored in the new vertex
public Edge attachVertex(Vertex v,
Object vertexElement,
Object edgeElement)
throws InvalidAccessorException
insertVertex(.) followed by insertEdge(.).
v - a vertexvertexElement - the object to be stored in vedgeElement - the object to be stored in the new edge
opposite(v,e)
InvalidAccessorException - if vertex to be attached to
does not belong to this graph
public Edge attachVertexFrom(Vertex origin,
Object vertexElement,
Object edgeElement)
throws InvalidAccessorException
insertVertex(.) followed by
insertDirectedEdge(.).
origin - a vertexvertexElement - the object to be stored in vedgeElement - the object to be stored in the new edge
e; to get the new vertex, use method
opposite(v,e)
InvalidAccessorException - if origin
does not belong to this graph
public Edge attachVertexTo(Vertex destination,
Object vertexElement,
Object edgeElement)
throws InvalidAccessorException
insertVertex(.) followed by
insertDirectedEdge(.).
destination - a vertexvertexElement - the object to be stored in vedgeElement - the object to be stored in the new edge
e; to get the new vertex, use method
opposite(v,e)
InvalidAccessorException - if destination
does not belong to this graph
public Edge insertEdge(Vertex v1,
Vertex v2,
Object element)
throws InvalidAccessorException
v1 - the first endvertexv2 - the second endvertexelement - the object to be stored in the new edge
InvalidAccessorException - if either v1 or
v2 does not belong to this graph
public Edge insertDirectedEdge(Vertex v1,
Vertex v2,
Object element)
throws InvalidAccessorException
v1 - the origin vertexv2 - the destination vertexelement - the object to be stored in the new edge
InvalidAccessorException - if either v1 or
v2 does not belong to this graph
public Object removeVertex(Vertex v)
throws InvalidAccessorException
v - the vertex to be deleted
v
InvalidAccessorException - if the vertex does not
belong to this graph
public Object removeEdge(Edge e)
throws InvalidAccessorException
e - the edge to be removed
e
InvalidAccessorException - if the edge does not belong
to this graph
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||