Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

AOldSimpleClassInstanceCreationExp.java

00001 package edu.ksu.cis.bandera.jjjc.node;
00002 
00003 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00004  * Bandera, a Java(TM) analysis and transformation toolkit           *
00005  * Copyright (C) 1998-2001 SAnToS Laboratories (santos@cis.ksu.edu)  *
00006 
00007  * All rights reserved.                                              *
00008  *                                                                   *
00009  * This work was done as a project in the SAnToS Laboratory,         *
00010  * Department of Computing and Information Sciences, Kansas State    *
00011  * University, USA (http://www.cis.ksu.edu/santos).                  *
00012  * It is understood that any modification not identified as such is  *
00013  * not covered by the preceding statement.                           *
00014  *                                                                   *
00015  * This work is free software; you can redistribute it and/or        *
00016  * modify it under the terms of the GNU Library General Public       *
00017  * License as published by the Free Software Foundation; either      *
00018  * version 2 of the License, or (at your option) any later version.  *
00019  *                                                                   *
00020  * This work is distributed in the hope that it will be useful,      *
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of    *
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU *
00023  * Library General Public License for more details.                  *
00024  *                                                                   *
00025  * You should have received a copy of the GNU Library General Public *
00026  * License along with this toolkit; if not, write to the             *
00027  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,      *
00028  * Boston, MA  02111-1307, USA.                                      *
00029  *                                                                   *
00030  * Java is a trademark of Sun Microsystems, Inc.                     *
00031  *                                                                   *
00032  * To submit a bug report, send a comment, or get the latest news on *
00033  * this project and other SAnToS projects, please visit the web-site *
00034  *                http://www.cis.ksu.edu/santos                      *
00035  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00036 import ca.mcgill.sable.util.*;
00037 import edu.ksu.cis.bandera.jjjc.analysis.*;
00038 
00039 public final class AOldSimpleClassInstanceCreationExp extends PClassInstanceCreationExp
00040 {
00041     private TNew _new_;
00042     private PName _name_;
00043     private TLPar _lPar_;
00044     private PArgumentList _argumentList_;
00045     private TRPar _rPar_;
00046     private PClassBody _classBody_;
00047 
00048     public AOldSimpleClassInstanceCreationExp()
00049     {
00050     }
00051     public AOldSimpleClassInstanceCreationExp(
00052         TNew _new_,
00053         PName _name_,
00054         TLPar _lPar_,
00055         PArgumentList _argumentList_,
00056         TRPar _rPar_,
00057         PClassBody _classBody_)
00058     {
00059         setNew(_new_);
00060 
00061         setName(_name_);
00062 
00063         setLPar(_lPar_);
00064 
00065         setArgumentList(_argumentList_);
00066 
00067         setRPar(_rPar_);
00068 
00069         setClassBody(_classBody_);
00070 
00071     }
00072     public void apply(Switch sw)
00073     {
00074         ((Analysis) sw).caseAOldSimpleClassInstanceCreationExp(this);
00075     }
00076     public Object clone()
00077     {
00078         return new AOldSimpleClassInstanceCreationExp(
00079             (TNew) cloneNode(_new_),
00080             (PName) cloneNode(_name_),
00081             (TLPar) cloneNode(_lPar_),
00082             (PArgumentList) cloneNode(_argumentList_),
00083             (TRPar) cloneNode(_rPar_),
00084             (PClassBody) cloneNode(_classBody_));
00085     }
00086     public PArgumentList getArgumentList()
00087     {
00088         return _argumentList_;
00089     }
00090     public PClassBody getClassBody()
00091     {
00092         return _classBody_;
00093     }
00094     public TLPar getLPar()
00095     {
00096         return _lPar_;
00097     }
00098     public PName getName()
00099     {
00100         return _name_;
00101     }
00102     public TNew getNew()
00103     {
00104         return _new_;
00105     }
00106     public TRPar getRPar()
00107     {
00108         return _rPar_;
00109     }
00110     void removeChild(Node child)
00111     {
00112         if(_new_ == child)
00113         {
00114             _new_ = null;
00115             return;
00116         }
00117 
00118         if(_name_ == child)
00119         {
00120             _name_ = null;
00121             return;
00122         }
00123 
00124         if(_lPar_ == child)
00125         {
00126             _lPar_ = null;
00127             return;
00128         }
00129 
00130         if(_argumentList_ == child)
00131         {
00132             _argumentList_ = null;
00133             return;
00134         }
00135 
00136         if(_rPar_ == child)
00137         {
00138             _rPar_ = null;
00139             return;
00140         }
00141 
00142         if(_classBody_ == child)
00143         {
00144             _classBody_ = null;
00145             return;
00146         }
00147 
00148     }
00149     void replaceChild(Node oldChild, Node newChild)
00150     {
00151         if(_new_ == oldChild)
00152         {
00153             setNew((TNew) newChild);
00154             return;
00155         }
00156 
00157         if(_name_ == oldChild)
00158         {
00159             setName((PName) newChild);
00160             return;
00161         }
00162 
00163         if(_lPar_ == oldChild)
00164         {
00165             setLPar((TLPar) newChild);
00166             return;
00167         }
00168 
00169         if(_argumentList_ == oldChild)
00170         {
00171             setArgumentList((PArgumentList) newChild);
00172             return;
00173         }
00174 
00175         if(_rPar_ == oldChild)
00176         {
00177             setRPar((TRPar) newChild);
00178             return;
00179         }
00180 
00181         if(_classBody_ == oldChild)
00182         {
00183             setClassBody((PClassBody) newChild);
00184             return;
00185         }
00186 
00187     }
00188     public void setArgumentList(PArgumentList node)
00189     {
00190         if(_argumentList_ != null)
00191         {
00192             _argumentList_.parent(null);
00193         }
00194 
00195         if(node != null)
00196         {
00197             if(node.parent() != null)
00198             {
00199                 node.parent().removeChild(node);
00200             }
00201 
00202             node.parent(this);
00203         }
00204 
00205         _argumentList_ = node;
00206     }
00207     public void setClassBody(PClassBody node)
00208     {
00209         if(_classBody_ != null)
00210         {
00211             _classBody_.parent(null);
00212         }
00213 
00214         if(node != null)
00215         {
00216             if(node.parent() != null)
00217             {
00218                 node.parent().removeChild(node);
00219             }
00220 
00221             node.parent(this);
00222         }
00223 
00224         _classBody_ = node;
00225     }
00226     public void setLPar(TLPar node)
00227     {
00228         if(_lPar_ != null)
00229         {
00230             _lPar_.parent(null);
00231         }
00232 
00233         if(node != null)
00234         {
00235             if(node.parent() != null)
00236             {
00237                 node.parent().removeChild(node);
00238             }
00239 
00240             node.parent(this);
00241         }
00242 
00243         _lPar_ = node;
00244     }
00245     public void setName(PName node)
00246     {
00247         if(_name_ != null)
00248         {
00249             _name_.parent(null);
00250         }
00251 
00252         if(node != null)
00253         {
00254             if(node.parent() != null)
00255             {
00256                 node.parent().removeChild(node);
00257             }
00258 
00259             node.parent(this);
00260         }
00261 
00262         _name_ = node;
00263     }
00264     public void setNew(TNew node)
00265     {
00266         if(_new_ != null)
00267         {
00268             _new_.parent(null);
00269         }
00270 
00271         if(node != null)
00272         {
00273             if(node.parent() != null)
00274             {
00275                 node.parent().removeChild(node);
00276             }
00277 
00278             node.parent(this);
00279         }
00280 
00281         _new_ = node;
00282     }
00283     public void setRPar(TRPar node)
00284     {
00285         if(_rPar_ != null)
00286         {
00287             _rPar_.parent(null);
00288         }
00289 
00290         if(node != null)
00291         {
00292             if(node.parent() != null)
00293             {
00294                 node.parent().removeChild(node);
00295             }
00296 
00297             node.parent(this);
00298         }
00299 
00300         _rPar_ = node;
00301     }
00302     public String toString()
00303     {
00304         return ""
00305             + toString(_new_)
00306             + toString(_name_)
00307             + toString(_lPar_)
00308             + toString(_argumentList_)
00309             + toString(_rPar_)
00310             + toString(_classBody_);
00311     }
00312 }

Generated at Thu Feb 7 06:38:53 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001