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

AParamResource.java

00001 package edu.ksu.cis.bandera.specification.pattern.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 /* This file was generated by SableCC (http://www.sable.mcgill.ca/sablecc/). */
00037 
00038 import java.util.*;
00039 import edu.ksu.cis.bandera.specification.pattern.analysis.*;
00040 
00041 public final class AParamResource extends PResource
00042 {
00043     private TId _id_;
00044     private TEqual _equal_;
00045     private TLBrace _lBrace_;
00046     private PIds _ids_;
00047     private TRBrace _rBrace_;
00048 
00049     public AParamResource()
00050     {
00051     }
00052     public AParamResource(
00053         TId _id_,
00054         TEqual _equal_,
00055         TLBrace _lBrace_,
00056         PIds _ids_,
00057         TRBrace _rBrace_)
00058     {
00059         setId(_id_);
00060 
00061         setEqual(_equal_);
00062 
00063         setLBrace(_lBrace_);
00064 
00065         setIds(_ids_);
00066 
00067         setRBrace(_rBrace_);
00068 
00069     }
00070     public void apply(Switch sw)
00071     {
00072         ((Analysis) sw).caseAParamResource(this);
00073     }
00074     public Object clone()
00075     {
00076         return new AParamResource(
00077             (TId) cloneNode(_id_),
00078             (TEqual) cloneNode(_equal_),
00079             (TLBrace) cloneNode(_lBrace_),
00080             (PIds) cloneNode(_ids_),
00081             (TRBrace) cloneNode(_rBrace_));
00082     }
00083     public TEqual getEqual()
00084     {
00085         return _equal_;
00086     }
00087     public TId getId()
00088     {
00089         return _id_;
00090     }
00091     public PIds getIds()
00092     {
00093         return _ids_;
00094     }
00095     public TLBrace getLBrace()
00096     {
00097         return _lBrace_;
00098     }
00099     public TRBrace getRBrace()
00100     {
00101         return _rBrace_;
00102     }
00103     void removeChild(Node child)
00104     {
00105         if(_id_ == child)
00106         {
00107             _id_ = null;
00108             return;
00109         }
00110 
00111         if(_equal_ == child)
00112         {
00113             _equal_ = null;
00114             return;
00115         }
00116 
00117         if(_lBrace_ == child)
00118         {
00119             _lBrace_ = null;
00120             return;
00121         }
00122 
00123         if(_ids_ == child)
00124         {
00125             _ids_ = null;
00126             return;
00127         }
00128 
00129         if(_rBrace_ == child)
00130         {
00131             _rBrace_ = null;
00132             return;
00133         }
00134 
00135     }
00136     void replaceChild(Node oldChild, Node newChild)
00137     {
00138         if(_id_ == oldChild)
00139         {
00140             setId((TId) newChild);
00141             return;
00142         }
00143 
00144         if(_equal_ == oldChild)
00145         {
00146             setEqual((TEqual) newChild);
00147             return;
00148         }
00149 
00150         if(_lBrace_ == oldChild)
00151         {
00152             setLBrace((TLBrace) newChild);
00153             return;
00154         }
00155 
00156         if(_ids_ == oldChild)
00157         {
00158             setIds((PIds) newChild);
00159             return;
00160         }
00161 
00162         if(_rBrace_ == oldChild)
00163         {
00164             setRBrace((TRBrace) newChild);
00165             return;
00166         }
00167 
00168     }
00169     public void setEqual(TEqual node)
00170     {
00171         if(_equal_ != null)
00172         {
00173             _equal_.parent(null);
00174         }
00175 
00176         if(node != null)
00177         {
00178             if(node.parent() != null)
00179             {
00180                 node.parent().removeChild(node);
00181             }
00182 
00183             node.parent(this);
00184         }
00185 
00186         _equal_ = node;
00187     }
00188     public void setId(TId node)
00189     {
00190         if(_id_ != null)
00191         {
00192             _id_.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         _id_ = node;
00206     }
00207     public void setIds(PIds node)
00208     {
00209         if(_ids_ != null)
00210         {
00211             _ids_.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         _ids_ = node;
00225     }
00226     public void setLBrace(TLBrace node)
00227     {
00228         if(_lBrace_ != null)
00229         {
00230             _lBrace_.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         _lBrace_ = node;
00244     }
00245     public void setRBrace(TRBrace node)
00246     {
00247         if(_rBrace_ != null)
00248         {
00249             _rBrace_.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         _rBrace_ = node;
00263     }
00264     public String toString()
00265     {
00266         return ""
00267             + toString(_id_)
00268             + toString(_equal_)
00269             + toString(_lBrace_)
00270             + toString(_ids_)
00271             + toString(_rBrace_);
00272     }
00273 }

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