ObjectDirectedEdge
public class DirectedEdge
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 |
|---|
public DirectedEdge(int v,
int w,
double weight)
| Method Detail |
|---|
public int from()
public int to()
public double weight()
public String toString()
toString in class Objectpublic static void main(String[] args)