public class DirectedEdge extends java.lang.Object
For additional documentation, see Section 4.4 of Algorithms, 4th Edition, by Robert Sedgewick and Kevin Wayne.
Constructor and Description |
---|
DirectedEdge(int v,
int w,
double weight)
Create a directed edge from v to w with given weight.
|
Modifier and Type | Method and Description |
---|---|
int |
from()
Return the vertex where this edge begins.
|
static void |
main(java.lang.String[] args)
Test client.
|
int |
to()
Return the vertex where this edge ends.
|
java.lang.String |
toString()
Return a string representation of this edge.
|
double |
weight()
Return the weight of this edge.
|
public DirectedEdge(int v, int w, double weight)
public int from()
public int to()
public double weight()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)