|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
V
- The vertices in the graph.public static interface UndirectedGraph.Edge<V>
A possible edge connecting two vertices of an underlying
UndirectedGraph
. The edge denoted by this object must not
necessarily exist in the graph -- use exists()
to check.
This is a convenience object mainly used for iterators, which can return
it as a tuple of two vertices. To avoid creating a huge amount of
objects, implementors are encouraged to let iterators always return
the same edge on a call to Iterator.next()
but with updated
vertices. Note that this means that a user has to use clone()
if he wants an edge independent of the iterator.
The methods should simply call the appropriate methods of the
underlying graph.
Method Summary | |
---|---|
UndirectedGraph.Edge<V> |
clone()
Clone this edge. |
boolean |
exists()
Check if this edge exists in the graph. |
V |
getVertexA()
|
V |
getVertexB()
|
double |
getWeight()
Get the weight of this edge. |
boolean |
isConnectedTo(V vertex)
Check if this edge is directly connected to a vertex. |
Method Detail |
---|
V getVertexA()
getVertexB()
V getVertexB()
getVertexA()
).boolean isConnectedTo(V vertex)
vertex
- The vertex.
getVertexA()
or getVertexB()
would
return given vertex.
java.lang.NullPointerException
- If the vertices is null
.boolean exists()
UndirectedGraph.containsEdge(Object, Object)
using the
two vertices of this edge as parameters.
java.util.NoSuchElementException
- If at least one of the vertices was
removed from the graph. The graph must be mutable to do so
(see UndirectedMutableGraph
).UndirectedGraph.containsEdge(Object, Object)
double getWeight()
UndirectedGraph.getEdgeWeight(Object, Object)
using the
two vertices of this edge as parameters.
UndirectedGraph.getUnconnectedWeight()
if this edge does not exist.
java.util.NoSuchElementException
- If at least one of the vertices was
removed from the graph. The graph must be mutable to do so
(see UndirectedMutableGraph
).exists()
UndirectedGraph.Edge<V> clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |