Package org._3pq.jgrapht.edge
Class DirectedWeightedEdge
- java.lang.Object
-
- org._3pq.jgrapht.edge.DefaultEdge
-
- org._3pq.jgrapht.edge.DirectedEdge
-
- org._3pq.jgrapht.edge.DirectedWeightedEdge
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,Edge
public class DirectedWeightedEdge extends DirectedEdge
An implementation of directed weighted edge.- Since:
- Jul 14, 2003
- Author:
- Barak Naveh
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org._3pq.jgrapht.Edge
DEFAULT_EDGE_WEIGHT
-
-
Constructor Summary
Constructors Constructor Description DirectedWeightedEdge(java.lang.Object sourceVertex, java.lang.Object targetVertex)DirectedWeightedEdge(java.lang.Object sourceVertex, java.lang.Object targetVertex, double weight)Constructor for DirectedWeightedEdge.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetWeight()Returns the weight of this edge.voidsetWeight(double weight)Sets the weight of this edge.-
Methods inherited from class org._3pq.jgrapht.edge.DirectedEdge
toString
-
Methods inherited from class org._3pq.jgrapht.edge.DefaultEdge
clone, containsVertex, getSource, getTarget, oppositeVertex
-
-
-
-
Constructor Detail
-
DirectedWeightedEdge
public DirectedWeightedEdge(java.lang.Object sourceVertex, java.lang.Object targetVertex)- See Also:
DirectedEdge(Object, Object)
-
DirectedWeightedEdge
public DirectedWeightedEdge(java.lang.Object sourceVertex, java.lang.Object targetVertex, double weight)Constructor for DirectedWeightedEdge.- Parameters:
sourceVertex- source vertex of the new edge.targetVertex- target vertex of the new edge.weight- the weight of the new edge.
-
-
Method Detail
-
setWeight
public void setWeight(double weight)
Description copied from interface:EdgeSets the weight of this edge. If this edge is unweighted anUnsupportedOperationExceptionis thrown.- Specified by:
setWeightin interfaceEdge- Overrides:
setWeightin classDefaultEdge- Parameters:
weight- new weight.- See Also:
Edge.setWeight(double)
-
getWeight
public double getWeight()
Description copied from interface:EdgeReturns the weight of this edge. If this edge is unweighted the value1.0is returned.- Specified by:
getWeightin interfaceEdge- Overrides:
getWeightin classDefaultEdge- Returns:
- the weight of this element.
- See Also:
Edge.getWeight()
-
-