-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNode.java
149 lines (118 loc) · 2.77 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import java.util.ArrayList;
public class Node
{
private int degree;
private Node rsibling;
private String color;
private Node parentRB;
private Node rChild;
private Node lChild;
private int degreeRB;
private Node parent;
private ArrayList<Node> child = new ArrayList<Node>();
private int builduingNum;
private int executed_time;
private int total_time;
public Node(){}
public Node(int degree, int builduingNum, int executed_time, int total_time){
this.degree = degree;
this.builduingNum = builduingNum;
this.executed_time = executed_time;
this.total_time = total_time;
}
public Node(int degree,Node rsibling, int builduingNum, int executed_time, int total_time){
this.degree = degree;
this.rsibling = rsibling;
this.builduingNum = builduingNum;
this.executed_time = executed_time;
this.total_time = total_time;
}
public Node(int degree, Node rsibling, Node parent, ArrayList<Node> child, int builduingNum, int executed_time, int total_time) {
this.degree = degree;
this.rsibling = rsibling;
this.parent = parent;
this.child = child;
this.builduingNum = builduingNum;
this.executed_time = executed_time;
this.total_time = total_time;
}
public Node getParentRB(){
return parentRB;
}
public Node getRightChild(){
return rChild;
}
public Node getLeftChild(){
return lChild;
}
public String getColor(){
return color;
}
public int getDegree(){
return degree;
}
public int getDegreeRB(){
return degreeRB;
}
public Node getRightSibling(){
return rsibling;
}
public Node getParent(){
return parent;
}
public ArrayList<Node> getChild(){
return child;
}
public int getBuildNum(){
return builduingNum;
}
public int getExecTime(){
return executed_time;
}
public int getTotalTime(){
return total_time;
}
public void setDegree(int degree){
this.degree = degree;
}
public void setRightSibling(Node rsibling){
this.rsibling = rsibling;
}
public void setParent(Node parent){
this.parent = parent;
}
public void setChild(ArrayList<Node> newChildList)
{
this.child = newChildList;
}
public void addChild(Node newChild){
child.add(newChild);
}
public void setBuildNum(int builduingNum){
this.builduingNum = builduingNum;
}
public void setExecTime(int executed_time){
this.executed_time = executed_time;
}
public void setTotalTime(int total_time){
this.total_time = total_time;
}
public void increaseDegreeRB(int val){
this.degree = val + this.degree;
}
public void setDegreeRB(int degree){
this.degree = degree;
}
public void setParentRB(Node parentRB){
this.parentRB = parentRB;
}
public void setRightChild(Node rChild){
this.rChild = rChild;
}
public void setLeftChild(Node lChild){
this.lChild = lChild;
}
public void setColor(String color){
this.color = color;
}
}