1 2 3 package soot.jimple.parser.node; 4 5 import java.util.*; 6 import soot.jimple.parser.analysis.*; 7 8 public final class AArrayNewExpr extends PNewExpr 9 { 10 private TNewarray _newarray_; 11 private TLParen _lParen_; 12 private PNonvoidType _nonvoidType_; 13 private TRParen _rParen_; 14 private PFixedArrayDescriptor _fixedArrayDescriptor_; 15 16 public AArrayNewExpr() 17 { 18 } 19 20 public AArrayNewExpr( 21 TNewarray _newarray_, 22 TLParen _lParen_, 23 PNonvoidType _nonvoidType_, 24 TRParen _rParen_, 25 PFixedArrayDescriptor _fixedArrayDescriptor_) 26 { 27 setNewarray(_newarray_); 28 29 setLParen(_lParen_); 30 31 setNonvoidType(_nonvoidType_); 32 33 setRParen(_rParen_); 34 35 setFixedArrayDescriptor(_fixedArrayDescriptor_); 36 37 } 38 public Object clone() 39 { 40 return new AArrayNewExpr( 41 (TNewarray) cloneNode(_newarray_), 42 (TLParen) cloneNode(_lParen_), 43 (PNonvoidType) cloneNode(_nonvoidType_), 44 (TRParen) cloneNode(_rParen_), 45 (PFixedArrayDescriptor) cloneNode(_fixedArrayDescriptor_)); 46 } 47 48 public void apply(Switch sw) 49 { 50 ((Analysis) sw).caseAArrayNewExpr(this); 51 } 52 53 public TNewarray getNewarray() 54 { 55 return _newarray_; 56 } 57 58 public void setNewarray(TNewarray node) 59 { 60 if(_newarray_ != null) 61 { 62 _newarray_.parent(null); 63 } 64 65 if(node != null) 66 { 67 if(node.parent() != null) 68 { 69 node.parent().removeChild(node); 70 } 71 72 node.parent(this); 73 } 74 75 _newarray_ = node; 76 } 77 78 public TLParen getLParen() 79 { 80 return _lParen_; 81 } 82 83 public void setLParen(TLParen node) 84 { 85 if(_lParen_ != null) 86 { 87 _lParen_.parent(null); 88 } 89 90 if(node != null) 91 { 92 if(node.parent() != null) 93 { 94 node.parent().removeChild(node); 95 } 96 97 node.parent(this); 98 } 99 100 _lParen_ = node; 101 } 102 103 public PNonvoidType getNonvoidType() 104 { 105 return _nonvoidType_; 106 } 107 108 public void setNonvoidType(PNonvoidType node) 109 { 110 if(_nonvoidType_ != null) 111 { 112 _nonvoidType_.parent(null); 113 } 114 115 if(node != null) 116 { 117 if(node.parent() != null) 118 { 119 node.parent().removeChild(node); 120 } 121 122 node.parent(this); 123 } 124 125 _nonvoidType_ = node; 126 } 127 128 public TRParen getRParen() 129 { 130 return _rParen_; 131 } 132 133 public void setRParen(TRParen node) 134 { 135 if(_rParen_ != null) 136 { 137 _rParen_.parent(null); 138 } 139 140 if(node != null) 141 { 142 if(node.parent() != null) 143 { 144 node.parent().removeChild(node); 145 } 146 147 node.parent(this); 148 } 149 150 _rParen_ = node; 151 } 152 153 public PFixedArrayDescriptor getFixedArrayDescriptor() 154 { 155 return _fixedArrayDescriptor_; 156 } 157 158 public void setFixedArrayDescriptor(PFixedArrayDescriptor node) 159 { 160 if(_fixedArrayDescriptor_ != null) 161 { 162 _fixedArrayDescriptor_.parent(null); 163 } 164 165 if(node != null) 166 { 167 if(node.parent() != null) 168 { 169 node.parent().removeChild(node); 170 } 171 172 node.parent(this); 173 } 174 175 _fixedArrayDescriptor_ = node; 176 } 177 178 public String toString() 179 { 180 return "" 181 + toString(_newarray_) 182 + toString(_lParen_) 183 + toString(_nonvoidType_) 184 + toString(_rParen_) 185 + toString(_fixedArrayDescriptor_); 186 } 187 188 void removeChild(Node child) 189 { 190 if(_newarray_ == child) 191 { 192 _newarray_ = null; 193 return; 194 } 195 196 if(_lParen_ == child) 197 { 198 _lParen_ = null; 199 return; 200 } 201 202 if(_nonvoidType_ == child) 203 { 204 _nonvoidType_ = null; 205 return; 206 } 207 208 if(_rParen_ == child) 209 { 210 _rParen_ = null; 211 return; 212 } 213 214 if(_fixedArrayDescriptor_ == child) 215 { 216 _fixedArrayDescriptor_ = null; 217 return; 218 } 219 220 } 221 222 void replaceChild(Node oldChild, Node newChild) 223 { 224 if(_newarray_ == oldChild) 225 { 226 setNewarray((TNewarray) newChild); 227 return; 228 } 229 230 if(_lParen_ == oldChild) 231 { 232 setLParen((TLParen) newChild); 233 return; 234 } 235 236 if(_nonvoidType_ == oldChild) 237 { 238 setNonvoidType((PNonvoidType) newChild); 239 return; 240 } 241 242 if(_rParen_ == oldChild) 243 { 244 setRParen((TRParen) newChild); 245 return; 246 } 247 248 if(_fixedArrayDescriptor_ == oldChild) 249 { 250 setFixedArrayDescriptor((PFixedArrayDescriptor) newChild); 251 return; 252 } 253 254 } 255 } 256 | Popular Tags |