Package dsa.lab10.base
Class Edge<Vertex,Weight>
java.lang.Object
dsa.lab10.base.Edge<Vertex,Weight>
- Type Parameters:
Vertex
- the vertex typeWeight
- the weight type
An edge in a directed graph.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Edge
Construct an edge between the given vertices with no weight data.- Parameters:
source
- the source vertextarget
- the target vertex
-
Edge
Construct an edge between the given vertices with the given weight.- Parameters:
source
- the source vertextarget
- the target vertexweight
- the weight data
-
-
Method Details
-
source
Get the source vertex.- Returns:
- the source vertex
-
target
Get the target vertex.- Returns:
- the target vertex
-
weight
Get the weight data (null
if there is none).- Returns:
- the weight data
-
equals
-
hashCode
public int hashCode() -
toString
-