-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathEdge.java
More file actions
36 lines (30 loc) · 802 Bytes
/
Edge.java
File metadata and controls
36 lines (30 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* Stores an edge's information.
* Based off of http://www.ibluemojo.com/school/ArticPointDFS.java
*
* Author: Kevin Richardson <[email protected]>
* Date: 10/11/11
* Time: 7:54 PM
*/
package us.magically.kevin.java.biconnectedcomponents;
class Edge
{
// Two vertices comprising this edge.
Vertex first, second;
// Create a new edge with the given vertices.
public Edge(Vertex first, Vertex second)
{
this.first = first;
this.second = second;
}
// Return the string representation of the edge in the form of a pair of vertices.
public String toString()
{
return "(" + first.id + ", " + second.id + ")";
}
// Check if two edges are equal by comparing the vertices.
boolean equal(Vertex a, Vertex b)
{
return (a.id == first.id) && (b.id == second.id);
}
}