00001 package edu.ksu.cis.bandera.jjjc.node;
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 import ca.mcgill.sable.util.*;
00037 import edu.ksu.cis.bandera.jjjc.analysis.*;
00038
00039 public final class ATypeOnDemandImportDeclaration extends PImportDeclaration
00040 {
00041 private TImport _import_;
00042 private PName _name_;
00043 private TDot _dot_;
00044 private TStar _star_;
00045 private TSemicolon _semicolon_;
00046
00047 public ATypeOnDemandImportDeclaration()
00048 {
00049 }
00050 public ATypeOnDemandImportDeclaration(
00051 TImport _import_,
00052 PName _name_,
00053 TDot _dot_,
00054 TStar _star_,
00055 TSemicolon _semicolon_)
00056 {
00057 setImport(_import_);
00058
00059 setName(_name_);
00060
00061 setDot(_dot_);
00062
00063 setStar(_star_);
00064
00065 setSemicolon(_semicolon_);
00066
00067 }
00068 public void apply(Switch sw)
00069 {
00070 ((Analysis) sw).caseATypeOnDemandImportDeclaration(this);
00071 }
00072 public Object clone()
00073 {
00074 return new ATypeOnDemandImportDeclaration(
00075 (TImport) cloneNode(_import_),
00076 (PName) cloneNode(_name_),
00077 (TDot) cloneNode(_dot_),
00078 (TStar) cloneNode(_star_),
00079 (TSemicolon) cloneNode(_semicolon_));
00080 }
00081 public TDot getDot()
00082 {
00083 return _dot_;
00084 }
00085 public TImport getImport()
00086 {
00087 return _import_;
00088 }
00089 public PName getName()
00090 {
00091 return _name_;
00092 }
00093 public TSemicolon getSemicolon()
00094 {
00095 return _semicolon_;
00096 }
00097 public TStar getStar()
00098 {
00099 return _star_;
00100 }
00101 void removeChild(Node child)
00102 {
00103 if(_import_ == child)
00104 {
00105 _import_ = null;
00106 return;
00107 }
00108
00109 if(_name_ == child)
00110 {
00111 _name_ = null;
00112 return;
00113 }
00114
00115 if(_dot_ == child)
00116 {
00117 _dot_ = null;
00118 return;
00119 }
00120
00121 if(_star_ == child)
00122 {
00123 _star_ = null;
00124 return;
00125 }
00126
00127 if(_semicolon_ == child)
00128 {
00129 _semicolon_ = null;
00130 return;
00131 }
00132
00133 }
00134 void replaceChild(Node oldChild, Node newChild)
00135 {
00136 if(_import_ == oldChild)
00137 {
00138 setImport((TImport) newChild);
00139 return;
00140 }
00141
00142 if(_name_ == oldChild)
00143 {
00144 setName((PName) newChild);
00145 return;
00146 }
00147
00148 if(_dot_ == oldChild)
00149 {
00150 setDot((TDot) newChild);
00151 return;
00152 }
00153
00154 if(_star_ == oldChild)
00155 {
00156 setStar((TStar) newChild);
00157 return;
00158 }
00159
00160 if(_semicolon_ == oldChild)
00161 {
00162 setSemicolon((TSemicolon) newChild);
00163 return;
00164 }
00165
00166 }
00167 public void setDot(TDot node)
00168 {
00169 if(_dot_ != null)
00170 {
00171 _dot_.parent(null);
00172 }
00173
00174 if(node != null)
00175 {
00176 if(node.parent() != null)
00177 {
00178 node.parent().removeChild(node);
00179 }
00180
00181 node.parent(this);
00182 }
00183
00184 _dot_ = node;
00185 }
00186 public void setImport(TImport node)
00187 {
00188 if(_import_ != null)
00189 {
00190 _import_.parent(null);
00191 }
00192
00193 if(node != null)
00194 {
00195 if(node.parent() != null)
00196 {
00197 node.parent().removeChild(node);
00198 }
00199
00200 node.parent(this);
00201 }
00202
00203 _import_ = node;
00204 }
00205 public void setName(PName node)
00206 {
00207 if(_name_ != null)
00208 {
00209 _name_.parent(null);
00210 }
00211
00212 if(node != null)
00213 {
00214 if(node.parent() != null)
00215 {
00216 node.parent().removeChild(node);
00217 }
00218
00219 node.parent(this);
00220 }
00221
00222 _name_ = node;
00223 }
00224 public void setSemicolon(TSemicolon node)
00225 {
00226 if(_semicolon_ != null)
00227 {
00228 _semicolon_.parent(null);
00229 }
00230
00231 if(node != null)
00232 {
00233 if(node.parent() != null)
00234 {
00235 node.parent().removeChild(node);
00236 }
00237
00238 node.parent(this);
00239 }
00240
00241 _semicolon_ = node;
00242 }
00243 public void setStar(TStar node)
00244 {
00245 if(_star_ != null)
00246 {
00247 _star_.parent(null);
00248 }
00249
00250 if(node != null)
00251 {
00252 if(node.parent() != null)
00253 {
00254 node.parent().removeChild(node);
00255 }
00256
00257 node.parent(this);
00258 }
00259
00260 _star_ = node;
00261 }
00262 public String toString()
00263 {
00264 return ""
00265 + toString(_import_)
00266 + toString(_name_)
00267 + toString(_dot_)
00268 + toString(_star_)
00269 + toString(_semicolon_);
00270 }
00271 }