public class DirectedWeightedEdge extends DirectedEdge
DEFAULT_EDGE_WEIGHT
Constructor and Description |
---|
DirectedWeightedEdge(java.lang.Object sourceVertex,
java.lang.Object targetVertex) |
DirectedWeightedEdge(java.lang.Object sourceVertex,
java.lang.Object targetVertex,
double weight)
Constructor for DirectedWeightedEdge.
|
Modifier and Type | Method and Description |
---|---|
double |
getWeight()
Returns the weight of this edge.
|
void |
setWeight(double weight)
Sets the weight of this edge.
|
toString
clone, containsVertex, getSource, getTarget, oppositeVertex
public DirectedWeightedEdge(java.lang.Object sourceVertex, java.lang.Object targetVertex)
public DirectedWeightedEdge(java.lang.Object sourceVertex, java.lang.Object targetVertex, double weight)
sourceVertex
- source vertex of the new edge.targetVertex
- target vertex of the new edge.weight
- the weight of the new edge.public void setWeight(double weight)
Edge
UnsupportedOperationException
is thrown.setWeight
in interface Edge
setWeight
in class DefaultEdge
weight
- new weight.Edge.setWeight(double)
public double getWeight()
Edge
1.0
is returned.getWeight
in interface Edge
getWeight
in class DefaultEdge
Edge.getWeight()