-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyNode.java
More file actions
69 lines (53 loc) · 1.34 KB
/
Copy pathMyNode.java
File metadata and controls
69 lines (53 loc) · 1.34 KB
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
61
62
63
64
65
66
67
68
69
public class MyNode {
private String color;
private MyNode next;
private MyNode prev;
private MyNode down;
private MyNode up;
public MyNode(String color, MyNode next, MyNode prev, MyNode down, MyNode up) {
this.color = color;
this.next = next;
this.prev = prev;
this.down = down;
this.up = up;
}
public MyNode(MyNode node){
this(node.getData(), node.getNext(), node.getPrev(), node.getDown(), node.getUp());
}
public MyNode(String color) {
this(color, null, null, null, null);
}
public String getData() {
return color;
}
public void setData(String color) {
this.color = color;
}
public MyNode getNext() {
return next;
}
public void setNext(MyNode next) {
this.next = next;
}
public MyNode getPrev() {
return prev;
}
public void setPrev(MyNode prev) {
this.prev = prev;
}
public MyNode getDown() {
return down;
}
public void setDown(MyNode down) {
this.down = down;
}
public MyNode getUp() {
return up;
}
public void setUp(MyNode up) {
this.up = up;
}
public String toString() {
return "" + color;
}
}