Class Edge

java.lang.Object
   |
   +----Edge

public class Edge
extends Object
A class representing an edge.


Constructor Index

 o Edge(Vertex, Vertex)
Construct an edge using two vertices.

Method Index

 o getVertices()
Returns the pair of end-point vertices of an edge.
 o sameEdge(Edge, Edge)
Check whether two edges are the same.
 o toString()
Produce a string describing an edge.

Constructors

 o Edge
 public Edge(Vertex v1,
             Vertex v2)
Construct an edge using two vertices.

Parameters:
v1, - v2 the end-points of the edge

Methods

 o sameEdge
 public static boolean sameEdge(Edge e1,
                                Edge e2)
Check whether two edges are the same.

Parameters:
e1, - e2 the edges to compare
Returns:
True/false if the edges are the same/different.
See Also:
sameVertex
 o getVertices
 public Vertex[] getVertices()
Returns the pair of end-point vertices of an edge.

Returns:
An array of two vertices in the order they were stored.
 o toString
 public String toString()
Produce a string describing an edge.

Overrides:
toString in class Object