Class DirectedEdge

Object
  extended by DirectedEdge

public class DirectedEdge
extends Object

The DirectedEdge class represents a weighted edge in an directed graph.

For additional documentation, see Section 4.4 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.


Constructor Summary
DirectedEdge(int v, int w, double weight)
          Create a directed edge from v to w with given weight.
 
Method Summary
 int from()
          Return the vertex where this edge begins.
static void main(String[] args)
          Test client.
 int to()
          Return the vertex where this edge ends.
 String toString()
          Return a string representation of this edge.
 double weight()
          Return the weight of this edge.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirectedEdge

public DirectedEdge(int v,
                    int w,
                    double weight)
Create a directed edge from v to w with given weight.

Method Detail

from

public int from()
Return the vertex where this edge begins.


to

public int to()
Return the vertex where this edge ends.


weight

public double weight()
Return the weight of this edge.


toString

public String toString()
Return a string representation of this edge.

Overrides:
toString in class Object

main

public static void main(String[] args)
Test client.