|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.algorithms.graphs.Edge
public class Edge
This class is a representation of a weighted edge.
| Field Summary | |
|---|---|
protected int |
source
The source node. |
protected int |
target
The target node. |
protected double |
weight
The weight of the edge. |
| Constructor Summary | |
|---|---|
Edge(int s,
int t,
double w)
Creates a new weighted edge. |
|
| Method Summary | |
|---|---|
Edge |
clone()
|
int |
compareTo(Edge e)
|
int |
getEndNode()
Returns the end node of the edge. |
int |
getStartNode()
Returns the start node of the edge. |
double |
getWeight()
Returns the weight of the edge. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int source
protected int target
protected double weight
| Constructor Detail |
|---|
public Edge(int s,
int t,
double w)
throws IllegalArgumentException
s - the start nodet - the target (=end) nodew - the weight of the edge
IllegalArgumentException - if the names of the nodes are less than 0| Method Detail |
|---|
public int getStartNode()
public int getEndNode()
public double getWeight()
public String toString()
toString in class Object
public int compareTo(Edge e)
throws ClassCastException
compareTo in interface Comparable<Edge>ClassCastExceptionpublic Edge clone()
clone in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||