00001 package edu.ksu.cis.bandera.specification.node;
00002
00003
00004
00005 import java.util.*;
00006 import edu.ksu.cis.bandera.specification.analysis.*;
00007
00008 public final class AAssert extends PAssert
00009 {
00010 private TDocumentationComment _documentationComment_;
00011 private TId _id_;
00012 private TColon _colon_;
00013 private TEnable _enable_;
00014 private TAssertions _assertions_;
00015 private TLBrace _lBrace_;
00016 private PNames _names_;
00017 private TRBrace _rBrace_;
00018 private TSemicolon _semicolon_;
00019
00020 public AAssert()
00021 {
00022 }
00023 public AAssert(
00024 TDocumentationComment _documentationComment_,
00025 TId _id_,
00026 TColon _colon_,
00027 TEnable _enable_,
00028 TAssertions _assertions_,
00029 TLBrace _lBrace_,
00030 PNames _names_,
00031 TRBrace _rBrace_,
00032 TSemicolon _semicolon_)
00033 {
00034 setDocumentationComment(_documentationComment_);
00035
00036 setId(_id_);
00037
00038 setColon(_colon_);
00039
00040 setEnable(_enable_);
00041
00042 setAssertions(_assertions_);
00043
00044 setLBrace(_lBrace_);
00045
00046 setNames(_names_);
00047
00048 setRBrace(_rBrace_);
00049
00050 setSemicolon(_semicolon_);
00051
00052 }
00053 public void apply(Switch sw)
00054 {
00055 ((Analysis) sw).caseAAssert(this);
00056 }
00057 public Object clone()
00058 {
00059 return new AAssert(
00060 (TDocumentationComment) cloneNode(_documentationComment_),
00061 (TId) cloneNode(_id_),
00062 (TColon) cloneNode(_colon_),
00063 (TEnable) cloneNode(_enable_),
00064 (TAssertions) cloneNode(_assertions_),
00065 (TLBrace) cloneNode(_lBrace_),
00066 (PNames) cloneNode(_names_),
00067 (TRBrace) cloneNode(_rBrace_),
00068 (TSemicolon) cloneNode(_semicolon_));
00069 }
00070 public TAssertions getAssertions()
00071 {
00072 return _assertions_;
00073 }
00074 public TColon getColon()
00075 {
00076 return _colon_;
00077 }
00078 public TDocumentationComment getDocumentationComment()
00079 {
00080 return _documentationComment_;
00081 }
00082 public TEnable getEnable()
00083 {
00084 return _enable_;
00085 }
00086 public TId getId()
00087 {
00088 return _id_;
00089 }
00090 public TLBrace getLBrace()
00091 {
00092 return _lBrace_;
00093 }
00094 public PNames getNames()
00095 {
00096 return _names_;
00097 }
00098 public TRBrace getRBrace()
00099 {
00100 return _rBrace_;
00101 }
00102 public TSemicolon getSemicolon()
00103 {
00104 return _semicolon_;
00105 }
00106 void removeChild(Node child)
00107 {
00108 if(_documentationComment_ == child)
00109 {
00110 _documentationComment_ = null;
00111 return;
00112 }
00113
00114 if(_id_ == child)
00115 {
00116 _id_ = null;
00117 return;
00118 }
00119
00120 if(_colon_ == child)
00121 {
00122 _colon_ = null;
00123 return;
00124 }
00125
00126 if(_enable_ == child)
00127 {
00128 _enable_ = null;
00129 return;
00130 }
00131
00132 if(_assertions_ == child)
00133 {
00134 _assertions_ = null;
00135 return;
00136 }
00137
00138 if(_lBrace_ == child)
00139 {
00140 _lBrace_ = null;
00141 return;
00142 }
00143
00144 if(_names_ == child)
00145 {
00146 _names_ = null;
00147 return;
00148 }
00149
00150 if(_rBrace_ == child)
00151 {
00152 _rBrace_ = null;
00153 return;
00154 }
00155
00156 if(_semicolon_ == child)
00157 {
00158 _semicolon_ = null;
00159 return;
00160 }
00161
00162 }
00163 void replaceChild(Node oldChild, Node newChild)
00164 {
00165 if(_documentationComment_ == oldChild)
00166 {
00167 setDocumentationComment((TDocumentationComment) newChild);
00168 return;
00169 }
00170
00171 if(_id_ == oldChild)
00172 {
00173 setId((TId) newChild);
00174 return;
00175 }
00176
00177 if(_colon_ == oldChild)
00178 {
00179 setColon((TColon) newChild);
00180 return;
00181 }
00182
00183 if(_enable_ == oldChild)
00184 {
00185 setEnable((TEnable) newChild);
00186 return;
00187 }
00188
00189 if(_assertions_ == oldChild)
00190 {
00191 setAssertions((TAssertions) newChild);
00192 return;
00193 }
00194
00195 if(_lBrace_ == oldChild)
00196 {
00197 setLBrace((TLBrace) newChild);
00198 return;
00199 }
00200
00201 if(_names_ == oldChild)
00202 {
00203 setNames((PNames) newChild);
00204 return;
00205 }
00206
00207 if(_rBrace_ == oldChild)
00208 {
00209 setRBrace((TRBrace) newChild);
00210 return;
00211 }
00212
00213 if(_semicolon_ == oldChild)
00214 {
00215 setSemicolon((TSemicolon) newChild);
00216 return;
00217 }
00218
00219 }
00220 public void setAssertions(TAssertions node)
00221 {
00222 if(_assertions_ != null)
00223 {
00224 _assertions_.parent(null);
00225 }
00226
00227 if(node != null)
00228 {
00229 if(node.parent() != null)
00230 {
00231 node.parent().removeChild(node);
00232 }
00233
00234 node.parent(this);
00235 }
00236
00237 _assertions_ = node;
00238 }
00239 public void setColon(TColon node)
00240 {
00241 if(_colon_ != null)
00242 {
00243 _colon_.parent(null);
00244 }
00245
00246 if(node != null)
00247 {
00248 if(node.parent() != null)
00249 {
00250 node.parent().removeChild(node);
00251 }
00252
00253 node.parent(this);
00254 }
00255
00256 _colon_ = node;
00257 }
00258 public void setDocumentationComment(TDocumentationComment node)
00259 {
00260 if(_documentationComment_ != null)
00261 {
00262 _documentationComment_.parent(null);
00263 }
00264
00265 if(node != null)
00266 {
00267 if(node.parent() != null)
00268 {
00269 node.parent().removeChild(node);
00270 }
00271
00272 node.parent(this);
00273 }
00274
00275 _documentationComment_ = node;
00276 }
00277 public void setEnable(TEnable node)
00278 {
00279 if(_enable_ != null)
00280 {
00281 _enable_.parent(null);
00282 }
00283
00284 if(node != null)
00285 {
00286 if(node.parent() != null)
00287 {
00288 node.parent().removeChild(node);
00289 }
00290
00291 node.parent(this);
00292 }
00293
00294 _enable_ = node;
00295 }
00296 public void setId(TId node)
00297 {
00298 if(_id_ != null)
00299 {
00300 _id_.parent(null);
00301 }
00302
00303 if(node != null)
00304 {
00305 if(node.parent() != null)
00306 {
00307 node.parent().removeChild(node);
00308 }
00309
00310 node.parent(this);
00311 }
00312
00313 _id_ = node;
00314 }
00315 public void setLBrace(TLBrace node)
00316 {
00317 if(_lBrace_ != null)
00318 {
00319 _lBrace_.parent(null);
00320 }
00321
00322 if(node != null)
00323 {
00324 if(node.parent() != null)
00325 {
00326 node.parent().removeChild(node);
00327 }
00328
00329 node.parent(this);
00330 }
00331
00332 _lBrace_ = node;
00333 }
00334 public void setNames(PNames node)
00335 {
00336 if(_names_ != null)
00337 {
00338 _names_.parent(null);
00339 }
00340
00341 if(node != null)
00342 {
00343 if(node.parent() != null)
00344 {
00345 node.parent().removeChild(node);
00346 }
00347
00348 node.parent(this);
00349 }
00350
00351 _names_ = node;
00352 }
00353 public void setRBrace(TRBrace node)
00354 {
00355 if(_rBrace_ != null)
00356 {
00357 _rBrace_.parent(null);
00358 }
00359
00360 if(node != null)
00361 {
00362 if(node.parent() != null)
00363 {
00364 node.parent().removeChild(node);
00365 }
00366
00367 node.parent(this);
00368 }
00369
00370 _rBrace_ = node;
00371 }
00372 public void setSemicolon(TSemicolon node)
00373 {
00374 if(_semicolon_ != null)
00375 {
00376 _semicolon_.parent(null);
00377 }
00378
00379 if(node != null)
00380 {
00381 if(node.parent() != null)
00382 {
00383 node.parent().removeChild(node);
00384 }
00385
00386 node.parent(this);
00387 }
00388
00389 _semicolon_ = node;
00390 }
00391 public String toString()
00392 {
00393 return ""
00394 + toString(_documentationComment_)
00395 + toString(_id_)
00396 + toString(_colon_)
00397 + toString(_enable_)
00398 + toString(_assertions_)
00399 + toString(_lBrace_)
00400 + toString(_names_)
00401 + toString(_rBrace_)
00402 + toString(_semicolon_);
00403 }
00404 }