org._3pq.jgrapht.edge
Class UndirectedWeightedEdge

java.lang.Object
  extended byorg._3pq.jgrapht.edge.DefaultEdge
      extended byorg._3pq.jgrapht.edge.UndirectedEdge
          extended byorg._3pq.jgrapht.edge.UndirectedWeightedEdge
All Implemented Interfaces:
java.lang.Cloneable, Edge, java.io.Serializable

public class UndirectedWeightedEdge
extends UndirectedEdge

An implementation of undirected weighted edge.

Since:
Jul 16, 2003
Author:
Barak Naveh
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org._3pq.jgrapht.Edge
DEFAULT_EDGE_WEIGHT
 
Constructor Summary
UndirectedWeightedEdge(java.lang.Object sourceVertex, java.lang.Object targetVertex)
           
UndirectedWeightedEdge(java.lang.Object sourceVertex, java.lang.Object targetVertex, double weight)
          Constructor for UndirectedWeightedEdge.
 
Method Summary
 double getWeight()
          Returns the weight of this edge.
 void setWeight(double weight)
          Sets the weight of this edge.
 
Methods inherited from class org._3pq.jgrapht.edge.UndirectedEdge
toString
 
Methods inherited from class org._3pq.jgrapht.edge.DefaultEdge
clone, containsVertex, getSource, getTarget, oppositeVertex
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UndirectedWeightedEdge

public UndirectedWeightedEdge(java.lang.Object sourceVertex,
                              java.lang.Object targetVertex)
See Also:
UndirectedEdge.UndirectedEdge(Object, Object)

UndirectedWeightedEdge

public UndirectedWeightedEdge(java.lang.Object sourceVertex,
                              java.lang.Object targetVertex,
                              double weight)
Constructor for UndirectedWeightedEdge.

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: Edge
Sets the weight of this edge. If this edge is unweighted an UnsupportedOperationException is thrown.

Specified by:
setWeight in interface Edge
Overrides:
setWeight in class DefaultEdge
See Also:
Edge.setWeight(double)

getWeight

public double getWeight()
Description copied from interface: Edge
Returns the weight of this edge. If this edge is unweighted the value 1.0 is returned.

Specified by:
getWeight in interface Edge
Overrides:
getWeight in class DefaultEdge
See Also:
Edge.getWeight()