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

ACollection.java

00001 package edu.ksu.cis.bandera.birp.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.birp.analysis.*;
00038 
00039 public final class ACollection extends PCollection
00040 {
00041     private TId _id_;
00042     private TColon _colon_;
00043     private TCollection _collection_;
00044     private TLbrack _lbrack_;
00045     private PConst _const_;
00046     private TRbrack _rbrack_;
00047     private TOf _of_;
00048     private PType _type_;
00049     private TSemicolon _semicolon_;
00050 
00051     public ACollection()
00052     {
00053     }
00054     public ACollection(
00055         TId _id_,
00056         TColon _colon_,
00057         TCollection _collection_,
00058         TLbrack _lbrack_,
00059         PConst _const_,
00060         TRbrack _rbrack_,
00061         TOf _of_,
00062         PType _type_,
00063         TSemicolon _semicolon_)
00064     {
00065         setId(_id_);
00066 
00067         setColon(_colon_);
00068 
00069         setCollection(_collection_);
00070 
00071         setLbrack(_lbrack_);
00072 
00073         setConst(_const_);
00074 
00075         setRbrack(_rbrack_);
00076 
00077         setOf(_of_);
00078 
00079         setType(_type_);
00080 
00081         setSemicolon(_semicolon_);
00082 
00083     }
00084     public void apply(Switch sw)
00085     {
00086         ((Analysis) sw).caseACollection(this);
00087     }
00088     public Object clone()
00089     {
00090         return new ACollection(
00091             (TId) cloneNode(_id_),
00092             (TColon) cloneNode(_colon_),
00093             (TCollection) cloneNode(_collection_),
00094             (TLbrack) cloneNode(_lbrack_),
00095             (PConst) cloneNode(_const_),
00096             (TRbrack) cloneNode(_rbrack_),
00097             (TOf) cloneNode(_of_),
00098             (PType) cloneNode(_type_),
00099             (TSemicolon) cloneNode(_semicolon_));
00100     }
00101     public TCollection getCollection()
00102     {
00103         return _collection_;
00104     }
00105     public TColon getColon()
00106     {
00107         return _colon_;
00108     }
00109     public PConst getConst()
00110     {
00111         return _const_;
00112     }
00113     public TId getId()
00114     {
00115         return _id_;
00116     }
00117     public TLbrack getLbrack()
00118     {
00119         return _lbrack_;
00120     }
00121     public TOf getOf()
00122     {
00123         return _of_;
00124     }
00125     public TRbrack getRbrack()
00126     {
00127         return _rbrack_;
00128     }
00129     public TSemicolon getSemicolon()
00130     {
00131         return _semicolon_;
00132     }
00133     public PType getType()
00134     {
00135         return _type_;
00136     }
00137     void removeChild(Node child)
00138     {
00139         if(_id_ == child)
00140         {
00141             _id_ = null;
00142             return;
00143         }
00144 
00145         if(_colon_ == child)
00146         {
00147             _colon_ = null;
00148             return;
00149         }
00150 
00151         if(_collection_ == child)
00152         {
00153             _collection_ = null;
00154             return;
00155         }
00156 
00157         if(_lbrack_ == child)
00158         {
00159             _lbrack_ = null;
00160             return;
00161         }
00162 
00163         if(_const_ == child)
00164         {
00165             _const_ = null;
00166             return;
00167         }
00168 
00169         if(_rbrack_ == child)
00170         {
00171             _rbrack_ = null;
00172             return;
00173         }
00174 
00175         if(_of_ == child)
00176         {
00177             _of_ = null;
00178             return;
00179         }
00180 
00181         if(_type_ == child)
00182         {
00183             _type_ = null;
00184             return;
00185         }
00186 
00187         if(_semicolon_ == child)
00188         {
00189             _semicolon_ = null;
00190             return;
00191         }
00192 
00193     }
00194     void replaceChild(Node oldChild, Node newChild)
00195     {
00196         if(_id_ == oldChild)
00197         {
00198             setId((TId) newChild);
00199             return;
00200         }
00201 
00202         if(_colon_ == oldChild)
00203         {
00204             setColon((TColon) newChild);
00205             return;
00206         }
00207 
00208         if(_collection_ == oldChild)
00209         {
00210             setCollection((TCollection) newChild);
00211             return;
00212         }
00213 
00214         if(_lbrack_ == oldChild)
00215         {
00216             setLbrack((TLbrack) newChild);
00217             return;
00218         }
00219 
00220         if(_const_ == oldChild)
00221         {
00222             setConst((PConst) newChild);
00223             return;
00224         }
00225 
00226         if(_rbrack_ == oldChild)
00227         {
00228             setRbrack((TRbrack) newChild);
00229             return;
00230         }
00231 
00232         if(_of_ == oldChild)
00233         {
00234             setOf((TOf) newChild);
00235             return;
00236         }
00237 
00238         if(_type_ == oldChild)
00239         {
00240             setType((PType) newChild);
00241             return;
00242         }
00243 
00244         if(_semicolon_ == oldChild)
00245         {
00246             setSemicolon((TSemicolon) newChild);
00247             return;
00248         }
00249 
00250     }
00251     public void setCollection(TCollection node)
00252     {
00253         if(_collection_ != null)
00254         {
00255             _collection_.parent(null);
00256         }
00257 
00258         if(node != null)
00259         {
00260             if(node.parent() != null)
00261             {
00262                 node.parent().removeChild(node);
00263             }
00264 
00265             node.parent(this);
00266         }
00267 
00268         _collection_ = node;
00269     }
00270     public void setColon(TColon node)
00271     {
00272         if(_colon_ != null)
00273         {
00274             _colon_.parent(null);
00275         }
00276 
00277         if(node != null)
00278         {
00279             if(node.parent() != null)
00280             {
00281                 node.parent().removeChild(node);
00282             }
00283 
00284             node.parent(this);
00285         }
00286 
00287         _colon_ = node;
00288     }
00289     public void setConst(PConst node)
00290     {
00291         if(_const_ != null)
00292         {
00293             _const_.parent(null);
00294         }
00295 
00296         if(node != null)
00297         {
00298             if(node.parent() != null)
00299             {
00300                 node.parent().removeChild(node);
00301             }
00302 
00303             node.parent(this);
00304         }
00305 
00306         _const_ = node;
00307     }
00308     public void setId(TId node)
00309     {
00310         if(_id_ != null)
00311         {
00312             _id_.parent(null);
00313         }
00314 
00315         if(node != null)
00316         {
00317             if(node.parent() != null)
00318             {
00319                 node.parent().removeChild(node);
00320             }
00321 
00322             node.parent(this);
00323         }
00324 
00325         _id_ = node;
00326     }
00327     public void setLbrack(TLbrack node)
00328     {
00329         if(_lbrack_ != null)
00330         {
00331             _lbrack_.parent(null);
00332         }
00333 
00334         if(node != null)
00335         {
00336             if(node.parent() != null)
00337             {
00338                 node.parent().removeChild(node);
00339             }
00340 
00341             node.parent(this);
00342         }
00343 
00344         _lbrack_ = node;
00345     }
00346     public void setOf(TOf node)
00347     {
00348         if(_of_ != null)
00349         {
00350             _of_.parent(null);
00351         }
00352 
00353         if(node != null)
00354         {
00355             if(node.parent() != null)
00356             {
00357                 node.parent().removeChild(node);
00358             }
00359 
00360             node.parent(this);
00361         }
00362 
00363         _of_ = node;
00364     }
00365     public void setRbrack(TRbrack node)
00366     {
00367         if(_rbrack_ != null)
00368         {
00369             _rbrack_.parent(null);
00370         }
00371 
00372         if(node != null)
00373         {
00374             if(node.parent() != null)
00375             {
00376                 node.parent().removeChild(node);
00377             }
00378 
00379             node.parent(this);
00380         }
00381 
00382         _rbrack_ = node;
00383     }
00384     public void setSemicolon(TSemicolon node)
00385     {
00386         if(_semicolon_ != null)
00387         {
00388             _semicolon_.parent(null);
00389         }
00390 
00391         if(node != null)
00392         {
00393             if(node.parent() != null)
00394             {
00395                 node.parent().removeChild(node);
00396             }
00397 
00398             node.parent(this);
00399         }
00400 
00401         _semicolon_ = node;
00402     }
00403     public void setType(PType node)
00404     {
00405         if(_type_ != null)
00406         {
00407             _type_.parent(null);
00408         }
00409 
00410         if(node != null)
00411         {
00412             if(node.parent() != null)
00413             {
00414                 node.parent().removeChild(node);
00415             }
00416 
00417             node.parent(this);
00418         }
00419 
00420         _type_ = node;
00421     }
00422     public String toString()
00423     {
00424         return ""
00425             + toString(_id_)
00426             + toString(_colon_)
00427             + toString(_collection_)
00428             + toString(_lbrack_)
00429             + toString(_const_)
00430             + toString(_rbrack_)
00431             + toString(_of_)
00432             + toString(_type_)
00433             + toString(_semicolon_);
00434     }
00435 }

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