1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package net.jbeans.j3d.modeler.geometry.util;
24
25 /* ------------------ Import classes (packages) ------------------- *//package-summary/html">class="comment"> ------------------ Import classes (packages) ------------------- *//package-summary.html">class="comment">/* ------------------ Import classes (packages) ------------------- *//package-summary.html">class="comment"> ------------------ Import classes (packages) ------------------- */
26
27
28
29
30
31 /***
32 * generally describe Edge in here
33 *
34 * @version $Revision: 1.3 $
35 * @author Masahiro Takatsuka (masa@jbeans.net)
36 */
37
38 class Edge {
39 private static final int HASHCONST = 0xedcba987;
40
41 int v1;
42 int v2;
43
44 Edge() {
45 super();
46 }
47
48 Edge(int i, int j) {
49 this.v1 = i;
50 this.v2 = j;
51 }
52
53 Edge(Edge edge) {
54 this.v1 = edge.v1;
55 this.v2 = edge.v2;
56 }
57
58 void set(int i, int j) {
59 this.v1 = i;
60 this.v2 = j;
61 }
62
63 public boolean equals(Object obj) {
64 if (!(obj instanceof Edge)){
65 return false;
66 } else {
67 Edge edge = (Edge) obj;
68 return this.v1 == edge.v1 && this.v2 == edge.v2;
69 }
70 }
71
72 public int hashCode() {
73 return this.v1 * 0xedcba987 << 2 ^ this.v2 * 0xedcba987;
74 }
75
76 public String toString() {
77 return "(" + this.v1 + ", " + this.v2 + ")";
78 }
79 }