|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg._3pq.jgrapht.edge.DefaultEdge
A skeletal implementation of the Edge interface, to minimize the effort required to implement the interface.
Field Summary |
Fields inherited from interface org._3pq.jgrapht.Edge |
DEFAULT_EDGE_WEIGHT |
Constructor Summary | |
DefaultEdge(java.lang.Object sourceVertex,
java.lang.Object targetVertex)
Constructor for DefaultEdge. |
Method Summary | |
java.lang.Object |
clone()
Creates and returns a shallow copy of this edge. |
boolean |
containsVertex(java.lang.Object v)
Returns true if this edge contains the specified vertex. |
java.lang.Object |
getSource()
Returns the source vertex of this edge. |
java.lang.Object |
getTarget()
Returns the target vertex of this edge. |
double |
getWeight()
Returns the weight of this edge. |
java.lang.Object |
oppositeVertex(java.lang.Object v)
Returns the vertex opposite to the specified vertex. |
void |
setWeight(double weight)
Sets the weight of this edge. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultEdge(java.lang.Object sourceVertex, java.lang.Object targetVertex)
sourceVertex
- source vertex of the edge.targetVertex
- target vertex of the edge.Method Detail |
public java.lang.Object getSource()
Edge
getSource
in interface Edge
Edge.getSource()
public java.lang.Object getTarget()
Edge
getTarget
in interface Edge
Edge.getTarget()
public void setWeight(double weight)
Edge
UnsupportedOperationException
is thrown.
setWeight
in interface Edge
weight
- new weight.Edge.setWeight(double)
public double getWeight()
Edge
1.0
is returned.
getWeight
in interface Edge
Edge.getWeight()
public java.lang.Object clone()
Edge
clone
in interface Edge
Edge.clone()
public boolean containsVertex(java.lang.Object v)
Edge
this.getSource().equals(v) || this.getTarget().equals(v)
containsVertex
in interface Edge
v
- vertex whose presence in this edge is to be tested.
Edge.containsVertex(java.lang.Object)
public java.lang.Object oppositeVertex(java.lang.Object v)
Edge
oppositeVertex
in interface Edge
v
- the vertex whose opposite is required.
Edge.oppositeVertex(java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |