|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Graph
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 nz.ac.waikato.jdsl.core.api.Position
, are
empty interfaces, for type safety only.
Vertex
,
Edge
,
ModifiableGraph
Method Summary | |
---|---|
Edge |
attachVertex(Vertex v,
java.lang.Object vertexElement,
java.lang.Object edgeElement)
Attaches a new vertex, containing an object, to an existing vertex by inserting a new undirected edge. |
Edge |
attachVertexFrom(Vertex origin,
java.lang.Object vertexElement,
java.lang.Object edgeElement)
Attaches a new vertex, containing an object, by inserting a new directed edge from an existing vertex. |
Edge |
attachVertexTo(Vertex destination,
java.lang.Object vertexElement,
java.lang.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,
java.lang.Object element)
Inserts a new directed edge from an existing vertex to another. |
Edge |
insertEdge(Vertex v1,
Vertex v2,
java.lang.Object element)
Inserts a new undirected edge between two existing vertices. |
Vertex |
insertVertex(java.lang.Object element)
Inserts a new isolated vertex. |
java.lang.Object |
removeEdge(Edge e)
|
java.lang.Object |
removeVertex(Vertex v)
Removes a vertex and all its incident edges. |
Methods inherited from interface nz.ac.waikato.jdsl.graph.api.ModifiableGraph |
---|
makeUndirected, reverseDirection, setDirectionFrom, setDirectionTo, splitEdge, unsplitEdge |
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 insertVertex(java.lang.Object element)
element
- the object to be stored in the new vertex
Edge attachVertex(Vertex v, java.lang.Object vertexElement, java.lang.Object edgeElement) throws InvalidAccessorException
insertVertex(.)
followed by insertEdge(.)
.
v
- a vertexvertexElement
- the object to be stored in v
edgeElement
- the object to be stored in the new edge
opposite(v,e)
InvalidAccessorException
- if vertex to be attached to
does not belong to this graphEdge attachVertexFrom(Vertex origin, java.lang.Object vertexElement, java.lang.Object edgeElement) throws InvalidAccessorException
insertVertex(.)
followed by
insertDirectedEdge(.)
.
origin
- a vertexvertexElement
- the object to be stored in v
edgeElement
- 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 graphEdge attachVertexTo(Vertex destination, java.lang.Object vertexElement, java.lang.Object edgeElement) throws InvalidAccessorException
insertVertex(.)
followed by
insertDirectedEdge(.)
.
destination
- a vertexvertexElement
- the object to be stored in v
edgeElement
- 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 graphEdge insertEdge(Vertex v1, Vertex v2, java.lang.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 graphEdge insertDirectedEdge(Vertex v1, Vertex v2, java.lang.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 graphjava.lang.Object removeVertex(Vertex v) throws InvalidAccessorException
v
- the vertex to be deleted
v
InvalidAccessorException
- if the vertex does not
belong to this graphjava.lang.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 |