KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > soot > jimple > parser > node > AConstantCaseLabel


1 /* This file was generated by SableCC (http://www.sablecc.org/). */
2
3 package soot.jimple.parser.node;
4
5 import java.util.*;
6 import soot.jimple.parser.analysis.*;
7
8 public final class AConstantCaseLabel extends PCaseLabel
9 {
10     private TCase _case_;
11     private TMinus _minus_;
12     private TIntegerConstant _integerConstant_;
13
14     public AConstantCaseLabel()
15     {
16     }
17
18     public AConstantCaseLabel(
19         TCase _case_,
20         TMinus _minus_,
21         TIntegerConstant _integerConstant_)
22     {
23         setCase(_case_);
24
25         setMinus(_minus_);
26
27         setIntegerConstant(_integerConstant_);
28
29     }
30     public Object JavaDoc clone()
31     {
32         return new AConstantCaseLabel(
33             (TCase) cloneNode(_case_),
34             (TMinus) cloneNode(_minus_),
35             (TIntegerConstant) cloneNode(_integerConstant_));
36     }
37
38     public void apply(Switch sw)
39     {
40         ((Analysis) sw).caseAConstantCaseLabel(this);
41     }
42
43     public TCase getCase()
44     {
45         return _case_;
46     }
47
48     public void setCase(TCase node)
49     {
50         if(_case_ != null)
51         {
52             _case_.parent(null);
53         }
54
55         if(node != null)
56         {
57             if(node.parent() != null)
58             {
59                 node.parent().removeChild(node);
60             }
61
62             node.parent(this);
63         }
64
65         _case_ = node;
66     }
67
68     public TMinus getMinus()
69     {
70         return _minus_;
71     }
72
73     public void setMinus(TMinus node)
74     {
75         if(_minus_ != null)
76         {
77             _minus_.parent(null);
78         }
79
80         if(node != null)
81         {
82             if(node.parent() != null)
83             {
84                 node.parent().removeChild(node);
85             }
86
87             node.parent(this);
88         }
89
90         _minus_ = node;
91     }
92
93     public TIntegerConstant getIntegerConstant()
94     {
95         return _integerConstant_;
96     }
97
98     public void setIntegerConstant(TIntegerConstant node)
99     {
100         if(_integerConstant_ != null)
101         {
102             _integerConstant_.parent(null);
103         }
104
105         if(node != null)
106         {
107             if(node.parent() != null)
108             {
109                 node.parent().removeChild(node);
110             }
111
112             node.parent(this);
113         }
114
115         _integerConstant_ = node;
116     }
117
118     public String JavaDoc toString()
119     {
120         return ""
121             + toString(_case_)
122             + toString(_minus_)
123             + toString(_integerConstant_);
124     }
125
126     void removeChild(Node child)
127     {
128         if(_case_ == child)
129         {
130             _case_ = null;
131             return;
132         }
133
134         if(_minus_ == child)
135         {
136             _minus_ = null;
137             return;
138         }
139
140         if(_integerConstant_ == child)
141         {
142             _integerConstant_ = null;
143             return;
144         }
145
146     }
147
148     void replaceChild(Node oldChild, Node newChild)
149     {
150         if(_case_ == oldChild)
151         {
152             setCase((TCase) newChild);
153             return;
154         }
155
156         if(_minus_ == oldChild)
157         {
158             setMinus((TMinus) newChild);
159             return;
160         }
161
162         if(_integerConstant_ == oldChild)
163         {
164             setIntegerConstant((TIntegerConstant) newChild);
165             return;
166         }
167
168     }
169 }
170
Popular Tags