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.
|
toStringclone, containsVertex, getSource, getTarget, oppositeVertexpublic 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)
EdgeUnsupportedOperationException is thrown.setWeight in interface EdgesetWeight in class DefaultEdgeweight - new weight.Edge.setWeight(double)public double getWeight()
Edge1.0 is returned.getWeight in interface EdgegetWeight in class DefaultEdgeEdge.getWeight()