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

Property.java

00001 package edu.ksu.cis.bandera.specification.datastructure;
00002 
00003 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00004  * Bandera, a Java(TM) analysis and transformation toolkit           *
00005  * Copyright (C) 2000   Robby (robby@cis.ksu.edu)                    *
00006  * All rights reserved.                                              *
00007  *                                                                   *
00008  * This work was done as a project in the SAnToS Laboratory,         *
00009  * Department of Computing and Information Sciences, Kansas State    *
00010  * University, USA (http://www.cis.ksu.edu/santos).                  *
00011  * It is understood that any modification not identified as such is  *
00012  * not covered by the preceding statement.                           *
00013  *                                                                   *
00014  * This work is free software; you can redistribute it and/or        *
00015  * modify it under the terms of the GNU Library General Public       *
00016  * License as published by the Free Software Foundation; either      *
00017  * version 2 of the License, or (at your option) any later version.  *
00018  *                                                                   *
00019  * This work is distributed in the hope that it will be useful,      *
00020  * but WITHOUT ANY WARRANTY; without even the implied warranty of    *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU *
00022  * Library General Public License for more details.                  *
00023  *                                                                   *
00024  * You should have received a copy of the GNU Library General Public *
00025  * License along with this toolkit; if not, write to the             *
00026  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,      *
00027  * Boston, MA  02111-1307, USA.                                      *
00028  *                                                                   *
00029  * Java is a trademark of Sun Microsystems, Inc.                     *
00030  *                                                                   *
00031  * To submit a bug report, send a comment, or get the latest news on *
00032  * this project and other SAnToS projects, please visit the web-site *
00033  *                http://www.cis.ksu.edu/santos                      *
00034  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00035 import java.util.*;
00036 import ca.mcgill.sable.soot.*;
00037 import edu.ksu.cis.bandera.jjjc.symboltable.Package;
00038 import edu.ksu.cis.bandera.jjjc.symboltable.*;
00039 import edu.ksu.cis.bandera.specification.assertion.datastructure.*;
00040 import edu.ksu.cis.bandera.specification.predicate.datastructure.*;
00041 
00042 
00043 public class Property {
00044     private String filename = "";
00045     private TreeSet importedType = new TreeSet();
00046     private TreeSet importedPackage = new TreeSet();
00047     private TreeSet importedPredicate = new TreeSet();
00048     private TreeSet importedPredicateSet = new TreeSet();
00049     private TreeSet importedAssertion = new TreeSet();
00050     private TreeSet importedAssertionSet = new TreeSet();
00051     private Hashtable assertionPropertyTable = new Hashtable();
00052     private TreeSet activatedAssertionProperty = new TreeSet();
00053     private Hashtable temporalLogicPropertyTable = new Hashtable();
00054     private TemporalLogicProperty activatedTemporalLogicProperty;
00055 /**
00056  * 
00057  * @param ap edu.ksu.cis.bandera.specification.datastructure.AssertionProperty
00058  */
00059 public void activateOrDeactivateAssertionProperty(AssertionProperty ap) {
00060     if (!activatedAssertionProperty.contains(ap)) {
00061         activatedAssertionProperty.add(ap);
00062     } else {
00063         activatedAssertionProperty.remove(ap);
00064     }
00065 }
00066 /**
00067  * 
00068  * @param tlp edu.ksu.cis.bandera.specification.datastructure.TemporalLogicProperty
00069  */
00070 public void activateOrDeactivateTemporalLogicProperty(TemporalLogicProperty tlp) {
00071     if (tlp == activatedTemporalLogicProperty)
00072         activatedTemporalLogicProperty = null;
00073     else
00074         activatedTemporalLogicProperty = tlp;
00075 }
00076 /**
00077  * 
00078  * @param ap edu.ksu.cis.bandera.specification.datastructure.AssertionProperty
00079  */
00080 public void addAssertionProperty(AssertionProperty ap) {
00081     assertionPropertyTable.put(ap.getName(), ap);
00082 }
00083 /**
00084  * 
00085  * @param tlp edu.ksu.cis.bandera.specification.datastructure.TemporalLogicProperty
00086  */
00087 public void addTemporalLogicProperty(TemporalLogicProperty tlp) {
00088     temporalLogicPropertyTable.put(tlp.getName(), tlp);
00089 }
00090 /**
00091  * 
00092  * @return java.util.TreeSet
00093  */
00094 public TreeSet getActivatedAssertionProperties() {
00095     return activatedAssertionProperty;
00096 }
00097 /**
00098  * 
00099  * @return edu.ksu.cis.bandera.specification.datastructure.TemporalLogicProperty
00100  */
00101 public TemporalLogicProperty getActivatedTemporalLogicProperty() {
00102     return activatedTemporalLogicProperty;
00103 }
00104 /**
00105  * 
00106  * @return java.util.Vector
00107  */
00108 public Vector getAssertionProperties() {
00109     TreeSet ts = new TreeSet();
00110     for (Enumeration e = assertionPropertyTable.elements(); e.hasMoreElements();) {
00111         ts.add(e.nextElement());
00112     }
00113     return new Vector(ts);
00114 }
00115 /**
00116  * 
00117  * @return edu.ksu.cis.bandera.specification.datastructure.AssertionProperty
00118  * @param name java.lang.String
00119  */
00120 public AssertionProperty getAssertionProperty(String name) {
00121     return (AssertionProperty) assertionPropertyTable.get(name);
00122 }
00123 /**
00124  * 
00125  * @return java.lang.String
00126  */
00127 public java.lang.String getFilename() {
00128     return filename;
00129 }
00130 /**
00131  * 
00132  * @return java.util.TreeSet
00133  */
00134 public java.util.TreeSet getImportedAssertion() {
00135     return importedAssertion;
00136 }
00137 /**
00138  * 
00139  * @return java.util.TreeSet
00140  */
00141 public java.util.TreeSet getImportedAssertionSet() {
00142     return importedAssertionSet;
00143 }
00144 /**
00145  * 
00146  * @return java.util.TreeSet
00147  */
00148 public java.util.TreeSet getImportedPackage() {
00149     return importedPackage;
00150 }
00151 /**
00152  * 
00153  * @return java.util.TreeSet
00154  */
00155 public java.util.TreeSet getImportedPredicate() {
00156     return importedPredicate;
00157 }
00158 /**
00159  * 
00160  * @return java.util.TreeSet
00161  */
00162 public java.util.TreeSet getImportedPredicateSet() {
00163     return importedPredicateSet;
00164 }
00165 /**
00166  * 
00167  * @return java.util.TreeSet
00168  */
00169 public java.util.TreeSet getImportedType() {
00170     return importedType;
00171 }
00172 /**
00173  * 
00174  * @return java.util.Vector
00175  */
00176 public Vector getTemporalLogicProperties() {
00177     TreeSet ts = new TreeSet();
00178     for (Enumeration e = temporalLogicPropertyTable.elements(); e.hasMoreElements();) {
00179         ts.add(e.nextElement());
00180     }
00181     return new Vector(ts);
00182 }
00183 /**
00184  * 
00185  * @return edu.ksu.cis.bandera.specification.datastructure.TemporalLogicProperty
00186  * @param name java.lang.String
00187  */
00188 public TemporalLogicProperty getTemporalLogicProperty(String name) {
00189     return (TemporalLogicProperty) temporalLogicPropertyTable.get(name);
00190 }
00191 /**
00192  * 
00193  * @return boolean
00194  * @param name java.lang.String
00195  */
00196 public boolean hasAssertionProperty(String name) {
00197     return assertionPropertyTable.get(name) != null;
00198 }
00199 /**
00200  * 
00201  * @return boolean
00202  * @param name java.lang.String
00203  */
00204 public boolean hasTemporalLogicProperty(String name) {
00205     return temporalLogicPropertyTable.get(name) != null;
00206 }
00207 /**
00208  * 
00209  * @param name edu.ksu.cis.bandera.jjjc.symboltable.Name
00210  */
00211 public void importAssertion(Name name) {
00212     importedAssertion.add(name);
00213 }
00214 /**
00215  * 
00216  * @param name edu.ksu.cis.bandera.jjjc.symboltable.Name
00217  */
00218 public void importAssertionSet(Name name) {
00219     importedAssertionSet.add(name);
00220 }
00221 /**
00222  * 
00223  * @param name edu.ksu.cis.bandera.jjjc.symboltable.Name
00224  */
00225 public void importPackage(Name name) {
00226     importedPackage.add(name);
00227 }
00228 /**
00229  * 
00230  * @param name edu.ksu.cis.bandera.jjjc.symboltable.Name
00231  */
00232 public void importPredicate(Name name) {
00233     importedPredicate.add(name);
00234 }
00235 /**
00236  * 
00237  * @param name edu.ksu.cis.bandera.jjjc.symboltable.Name
00238  */
00239 public void importPredicateSet(Name name) {
00240     importedPredicateSet.add(name);
00241 }
00242 /**
00243  * 
00244  * @param name edu.ksu.cis.bandera.jjjc.symboltable.Name
00245  */
00246 public void importType(Name name) {
00247     importedType.add(name);
00248 }
00249 /**
00250  *
00251  * @return boolean
00252  * @param ap edu.ksu.cis.bandera.specification.datastructure.AssertionProperty
00253  */
00254 public boolean isActivated(AssertionProperty ap) {
00255     return activatedAssertionProperty.contains(ap);
00256 }
00257 /**
00258  * 
00259  * @return boolean
00260  * @param tlp edu.ksu.cis.bandera.specification.datastructure.TemporalLogicProperty
00261  */
00262 public boolean isActivated(TemporalLogicProperty tlp) {
00263     return activatedTemporalLogicProperty == tlp;
00264 }
00265 /**
00266  * 
00267  * @param ap edu.ksu.cis.bandera.specification.datastructure.AssertionProperty
00268  */
00269 public void removeAssertionProperty(AssertionProperty ap) {
00270     for (Enumeration e = assertionPropertyTable.keys(); e.hasMoreElements();) {
00271         Object key = e.nextElement();
00272         Object value = assertionPropertyTable.get(key);
00273         if (value == ap) {
00274             assertionPropertyTable.remove(key);
00275             break;
00276         }
00277     }
00278     activatedAssertionProperty.remove(ap);
00279 }
00280 /**
00281  * 
00282  * @param name edu.ksu.cis.bandera.jjjc.symboltable.Name
00283  */
00284 public void removeImportedAssertion(Name name) {
00285     importedAssertion.remove(name);
00286 }
00287 /**
00288  * 
00289  * @param name edu.ksu.cis.bandera.jjjc.symboltable.Name
00290  */
00291 public void removeImportedAssertionSet(Name name) {
00292     importedAssertionSet.remove(name);
00293 }
00294 /**
00295  * 
00296  * @param name edu.ksu.cis.bandera.jjjc.symboltable.Name
00297  */
00298 public void removeImportedPackage(Name name) {
00299     importedPackage.remove(name);
00300 }
00301 /**
00302  * 
00303  * @param name edu.ksu.cis.bandera.jjjc.symboltable.Name
00304  */
00305 public void removeImportedPredicate(Name name) {
00306     importedPredicate.remove(name);
00307 }
00308 /**
00309  * 
00310  * @param name edu.ksu.cis.bandera.jjjc.symboltable.Name
00311  */
00312 public void removeImportedPredicateSet(Name name) {
00313     importedPredicateSet.remove(name);
00314 }
00315 /**
00316  * 
00317  * @param name edu.ksu.cis.bandera.jjjc.symboltable.Name
00318  */
00319 public void removeImportedType(Name name) {
00320     importedType.remove(name);
00321 }
00322 /**
00323  * 
00324  * @param tlp edu.ksu.cis.bandera.specification.datastructure.TemporalLogicProperty
00325  */
00326 public void removeTemporalLogicProperty(TemporalLogicProperty tlp) {
00327     for (Enumeration e = temporalLogicPropertyTable.keys(); e.hasMoreElements();) {
00328         Object key = e.nextElement();
00329         Object value = temporalLogicPropertyTable.get(key);
00330         if (value == tlp) {
00331             temporalLogicPropertyTable.remove(key);
00332             break;
00333         }
00334     }
00335     if (activatedTemporalLogicProperty == tlp)
00336         activatedTemporalLogicProperty = null;
00337 }
00338 /**
00339  * 
00340  * @param newFilename java.lang.String
00341  */
00342 public void setFilename(java.lang.String newFilename) {
00343     filename = newFilename;
00344 }
00345 }

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