class GraphEdge { // =================================================================== protected int vertex = -1; // vertex is destination of edge protected int weight = -1; // weight is cost associated with edge public GraphEdge(int v, int w) { vertex = v; weight = w; } // Returns the vertex that this GraphEdge represents. public int getVertex() { return vertex; } // Returns the weight associated with this GraphEdge. public int getWeight() { return weight; } // Returns true if obj is a GraphEdge and if obj's vertex // equals this vertex. The weights can be ignored in // determining equality. public boolean equals(Object obj) { GraphEdge edge = (GraphEdge) obj; return (edge.getVertex() == this.getVertex()); } // Returns a string containing the vertex and weight represented // by this node as an ordered pair. public String toString() { return "(" + vertex + ", " + weight + ")"; } } // end GraphEdge