|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jdsl.core.ref.AbstractPositionalContainer
|
+--jdsl.graph.ref.AbstractGraph
|
+--jdsl.graph.ref.InspectableSubgraph
This class represents a subgraph of an InspectableGraph. It
can be constructed from a set of vertices or edges
Note that Positions returned by the
subgraph will be the same as the positions returned in the original graph.
Even though this is an AbstractGraph, you may not modify this
graph. All attempts to do so will fail.
This graph maintains a reference to the graph upon which this subgraph is
induced. If that graph changes, then the inspectable graph will change.
| Inner classes inherited from class jdsl.graph.ref.AbstractGraph |
AbstractGraph.OO_to_O_MergerIterator |
| Constructor Summary | |
InspectableSubgraph(InspectableGraph graph,
EdgeIterator edges)
Constructs the subgraph induced by the given edges. |
|
InspectableSubgraph(InspectableGraph graph,
VertexIterator vertices)
Constructs the subgraph induced by the given vertices. |
|
| Method Summary | |
Edge |
anEdge()
This runs in time proportional to the running time of the corresponding method in the graph around which this subgraph wraps. |
Edge |
anIncidentEdge(Vertex v)
This runs in time proportional to the running time of the corresponding method in the graph around which this subgraph wraps. |
Edge |
anIncidentEdge(Vertex v,
int edgeType)
This runs in time proportional to the running time of the corresponding method in the graph around which this subgraph wraps. |
boolean |
areIncident(Vertex v,
Edge e)
O(1) |
Vertex |
aVertex()
This runs in time proportional to the running time of the corresponding method in the graph around which this subgraph wraps. |
boolean |
contains(Accessor a)
O(1) |
int |
degree(Vertex v)
This runs in time proportional to the running time of the corresponding method in the graph around which this subgraph wraps. |
int |
degree(Vertex v,
int edgeType)
This runs in time proportional to the running time of the corresponding method in the graph around which this subgraph wraps. |
Vertex |
destination(Edge e)
O(1) |
EdgeIterator |
edges()
O(E in subgraph ) |
ObjectIterator |
elements()
Runs in time proportional to vertices() +
elements() in the subgraph. |
Vertex[] |
endVertices(Edge e)
|
EdgeIterator |
incidentEdges(Vertex v)
This runs in time proportional to the running time of the corresponding method in the graph around which this subgraph wraps. |
EdgeIterator |
incidentEdges(Vertex v,
int edgeType)
This runs in time proportional to the running time of the corresponding method in the graph around which this subgraph wraps. |
boolean |
isDirected(Edge e)
This runs in time proportional to the running time of the corresponding method in the graph around which this subgraph wraps. |
Container |
newContainer()
This method is unsupported. |
int |
numEdges()
O(1) |
int |
numVertices()
O(1) |
Vertex |
opposite(Vertex v,
Edge e)
O(1) |
Vertex |
origin(Edge e)
O(1) |
java.lang.Object |
replaceElement(Accessor a,
java.lang.Object obj)
This method is unsupported. |
VertexIterator |
vertices()
O( V in subgraph ) |
| Methods inherited from class jdsl.graph.ref.AbstractGraph |
aCommonVertex, aConnectingEdge, adjacentVertices, adjacentVertices, areAdjacent, areAdjacent, connectingEdges, directedEdges, positions, size, undirectedEdges |
| Methods inherited from class jdsl.core.ref.AbstractPositionalContainer |
isEmpty, swapElements |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jdsl.core.api.InspectableContainer |
isEmpty |
| Constructor Detail |
public InspectableSubgraph(InspectableGraph graph,
VertexIterator vertices)
public InspectableSubgraph(InspectableGraph graph,
EdgeIterator edges)
| Method Detail |
public java.lang.Object replaceElement(Accessor a,
java.lang.Object obj)
throws InvalidAccessorException
jdsl.core.api.Containera - Accessor in this containernewElement - to be stored at aInvalidAccessorException - if a is null or does not
belong to this containerpublic int numVertices()
jdsl.graph.api.InspectableGraphpublic VertexIterator vertices()
jdsl.graph.api.InspectableGraphpublic int numEdges()
jdsl.graph.api.InspectableGraphpublic EdgeIterator edges()
jdsl.graph.api.InspectableGraphpublic EdgeIterator incidentEdges(Vertex v)
jdsl.graph.api.InspectableGraphv - a vertexvInvalidAccessorException - if v is not
contained in this graph
public EdgeIterator incidentEdges(Vertex v,
int edgeType)
jdsl.graph.api.InspectableGraphv - a vertexedgetype - A constant from the EdgeDirection interfacevInvalidAccessorException - if v is not
contained in this graphEdgeDirectionpublic boolean isDirected(Edge e)
jdsl.graph.api.InspectableGraphe - an edgetrue if e is directed,
false otherwiseInvalidAccessorException - if e is not
contained in this graph
public Vertex[] endVertices(Edge e)
throws InvalidAccessorException
jdsl.graph.api.InspectableGraphe - an edgee;
if e is directed, the first element of the array is the origin of e
and the second element is the destination of eInvalidAccessorException - if e is not
contained in this graphpublic Vertex aVertex()
jdsl.graph.api.InspectableGraphpublic Edge anEdge()
jdsl.graph.api.InspectableGraph
public Vertex opposite(Vertex v,
Edge e)
jdsl.graph.api.InspectableGraphv - one endvertex of ee - an edgee different from vInvalidVertexException - if v is not an
endvertex of eInvalidAccessorException - if v or e
is not contained in this graphpublic Vertex origin(Edge e)
jdsl.graph.api.InspectableGraphe - an edgee, if e is directedInvalidEdgeException - if e is undirectedInvalidAccessorException - if e is not
contained in this graphpublic Vertex destination(Edge e)
jdsl.graph.api.InspectableGraphe - an edgee, if
e is directedInvalidEdgeException - if e is undirectedInvalidAccessorException - if e is not
contained in this graph
public boolean areIncident(Vertex v,
Edge e)
jdsl.graph.api.InspectableGraphv - a vertexe - an edgev and e are incident,
i.e., whether v is an endvertex of eInvalidAccessorException - if either v or
e is not contained in this graphpublic Container newContainer()
jdsl.core.api.Containerpublic boolean contains(Accessor a)
jdsl.core.api.InspectableContainerInvalidAccessorException - if a is null
public Edge anIncidentEdge(Vertex v)
throws NoSuchEdgeException,
InvalidAccessorException
jdsl.graph.api.InspectableGraphv - a vertexv, or Edge.NONE if
there is no edge incident on vInvalidAccessorException - if v is not
contained in this graph
public Edge anIncidentEdge(Vertex v,
int edgeType)
jdsl.graph.api.InspectableGraphv - a vertexedgetype - A constant from the EdgeDirection interfacev,
or Edge.NONE if there is no such edge incident on vInvalidAccessorException - if v is not
contained in this graphEdgeDirectionpublic int degree(Vertex v)
jdsl.graph.api.InspectableGraphv - a vertexvInvalidAccessorException - if v is
not contained in this graph
public int degree(Vertex v,
int edgeType)
jdsl.graph.api.InspectableGraphv - a vertexedgetype - A constant from the EdgeDirection interfacevInvalidAccessorException - if v is
not contained in this graphEdgeDirectionpublic ObjectIterator elements()
vertices() +
elements() in the subgraph.jdsl.core.api.InspectableContainer
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||