Source of 30.10.java


  1: // @author Frank M. Carrano, Timothy M. Henry
  2: // @version 5.0
  3: protected class Edge
  4: {
  5:    private VertexInterface<T> vertex; // Vertex at end of edge
  6:    private double weight;

  8:    protected Edge(VertexInterface<T> endVertex, double edgeWeight)
  9:    {
 10:       vertex = endVertex;
 11:       weight = edgeWeight;
 12:    } // end constructor

 14:    protected Edge(VertexInterface<T> endVertex)
 15:    {
 16:       vertex = endVertex;
 17:       weight = 0;
 18:    } // end constructor
 19:    
 20:    protected VertexInterface<T> getEndVertex()
 21:    {
 22:       return vertex; 
 23:    } // end getEndVertex

 25:    protected double getWeight() 
 26:    {
 27:       return weight; 
 28:    } // end getWeight
 29: } // end Edge