|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ModifiableGraph
An interface describing the modifier methods of a combinatorial graph that can safely be inherited by more restricted graphs.
InspectableGraph
Method Summary | |
---|---|
void |
makeUndirected(Edge e)
Makes a directed edge undirected. |
void |
reverseDirection(Edge e)
Reverse the direction of an edge. |
void |
setDirectionFrom(Edge e,
Vertex v)
Sets the direction of an edge away from a vertex. |
void |
setDirectionTo(Edge e,
Vertex v)
Sets the direction of an edge towards a vertex. |
Vertex |
splitEdge(Edge e,
java.lang.Object vertElement)
Splits an existing edge by inserting a new vertex and two new edges, and removing the old edge. |
Edge |
unsplitEdge(Vertex v,
java.lang.Object edgeElement)
Transforms edge-vertex-edge into a single edge. |
Methods inherited from interface nz.ac.waikato.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 nz.ac.waikato.jdsl.core.api.PositionalContainer |
---|
swapElements |
Methods inherited from interface nz.ac.waikato.jdsl.core.api.InspectablePositionalContainer |
---|
positions |
Methods inherited from interface nz.ac.waikato.jdsl.core.api.Container |
---|
newContainer, replaceElement |
Methods inherited from interface nz.ac.waikato.jdsl.core.api.InspectableContainer |
---|
contains, elements, isEmpty, size |
Method Detail |
---|
Vertex splitEdge(Edge e, java.lang.Object vertElement) throws InvalidAccessorException
element()
can still be retrieved. The new edges store null elements, and the new
vertex stores the specified element.
e
- the edge to be splitvertElement
- the object to be stored in v
w
; to get the new edges, use method
incidentEdges(w)
InvalidAccessorException
- if the edge does not belong
to this graphEdge unsplitEdge(Vertex v, java.lang.Object edgeElement) throws InvalidAccessorException, InvalidVertexException
element()s
can still be retrieved), and a new edge is
inserted in their place. The new edge stores the specified element.
If the two incident edges of v
are consistently directed, the new edge is directed in that
direction. If they are both undirected, the new edge
is undirected. Any other combination of directions also results in
an undirected edge.
v
- the vertex to be removededgeElement
- the element to be stored in the new edge
InvalidVertexException
- If the vertex is not of degree 2
or is of degree 2 but the "two" edges are a single self-loop
InvalidAccessorException
- if the vertex does not
belong to this graphvoid setDirectionFrom(Edge e, Vertex v) throws InvalidAccessorException, InvalidVertexException
e
- an edgev
- an endvertex of e
InvalidVertexException
- if v
is not an
endvertex of e
but both v
and
e
belong to this graph
InvalidAccessorException
- if either e
or
v
does not belong to this graphvoid setDirectionTo(Edge e, Vertex v) throws InvalidAccessorException, InvalidVertexException
e
- an edgev
- an endvertex of e
InvalidVertexException
- if v
is not an
endvertex of e
InvalidAccessorException
- if either e
or
v
does not belong to this graphvoid makeUndirected(Edge e) throws InvalidAccessorException
e
- an edge
InvalidAccessorException
- if the edge does not belong
to this graphvoid reverseDirection(Edge e) throws InvalidEdgeException, InvalidAccessorException
e
- an edge
InvalidEdgeException
- If the edge is undirected
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 |