1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.common.messagebuilder.booleanmessage.ast;
17
18 import org.antlr.runtime.Token;
19 import org.antlr.runtime.tree.CommonTree;
20
21
22
23
24 public class BooleanNode extends CommonTree {
25
26 private BooleanNode parent;
27 private Boolean value;
28 private String nodeMessage;
29 private String language;
30
31
32
33
34
35
36
37
38 public BooleanNode(Token payload) {
39 super(payload);
40 }
41
42
43
44
45
46
47 public BooleanNode getParent(){
48 return parent;
49 }
50
51
52
53
54
55
56 public BooleanNode getLeftNode(){
57 return (BooleanNode) this.getChild(0);
58 }
59
60
61
62
63
64
65 public BooleanNode getRightNode(){
66 return (BooleanNode) this.getChild(1);
67 }
68
69
70
71
72
73
74 public String getLabel(){
75 return this.getText();
76 }
77
78
79
80
81
82
83 public Boolean getValue(){
84 return value;
85 }
86
87
88
89
90
91
92 public String getNodeMessage(){
93 return nodeMessage;
94 }
95
96
97
98
99
100
101 public String getLanguage() {
102 return language;
103 }
104
105
106
107
108
109
110
111 public void setParent(BooleanNode parent){
112 this.parent = parent;
113 }
114
115
116
117
118
119
120 public void setValue(Boolean value){
121 this.value = value;
122 }
123
124
125
126
127
128
129 public void setNodeMessage(String nodeMessage){
130 this.nodeMessage = nodeMessage;
131 }
132
133
134
135
136
137
138 public void setLanguage(String language) {
139 this.language = language;
140 }
141
142 @Override
143 public String toString() {
144 return "BooleanNode["
145 + "label=" + getLabel()
146 + ", value=" + value
147 + ", leftNodeLabel=" + (getLeftNode() == null ? null : getLeftNode().getLabel())
148 + ", rightNodeLabel=" + (getRightNode() == null ? null : getRightNode().getLabel())
149 + ", parentLabel=" + (parent == null ? null : parent.getLabel())
150 + "]";
151 }
152
153 }