-
Notifications
You must be signed in to change notification settings - Fork 0
/
Node.java
60 lines (48 loc) · 1.1 KB
/
Node.java
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
public class Node {
private int no;
private int color;
private int degree;
private int dsat;
public Node(int no) {
this.no = no;
color = -1;
degree = 0;
dsat = 0;
}
public String toString() {
return String.format("no: %d color: %d degree: %d dsat: %d\n", no, color, degree, dsat);
}
public int getNo() {
return no;
}
public int getColor() {
return color;
}
public int getDegree() {
return degree;
}
public int getDsat() {
return dsat;
}
public void setNo(int no) {
this.no = no;
}
public void setColor(int color) {
this.color = color;
}
public void setDegree(int degree) {
this.degree = degree;
}
public void setDsat(int dsat) {
this.dsat = dsat;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null || obj.getClass() != this.getClass())
return false;
var node = (Node) obj;
return this.no == node.no;
}
}