Package ca.ucalgary.ispia.rebac

Examples of ca.ucalgary.ispia.rebac.Variable


      return false;
    }
    if (!(obj instanceof Variable)){
      return false;
    }
    Variable other = (Variable) obj;
    if (variable == null){
      if (other.getVariable() != null){
        return false;    // False if contained proposition is null, and obj's proposition is not null
      }
    } else if (!(variable.equals(other.getVariable()))) {
      return false;      // False if proposition does not match
    }
    return true;
  }
View Full Code Here


   

    if (policy instanceof Variable) {

      Variable temp = (Variable) policy;

      free_vars.add(temp.getVariable());

    }

    else if (policy instanceof False){

      //nothing added

    }

    else if (policy instanceof True){

      //nothing added

    }
   
    else if (policy instanceof Requestor){
      //noting added
    }

    else if (policy instanceof Owner){
      //nothing added
    }
   

    else if(policy instanceof Negation){

      Negation temp = (Negation) policy;

      findFreeVars(temp.getPolicy(), free_vars);

    }

   

    else if (policy instanceof Conjunction){

      Conjunction temp = (Conjunction) policy;

     

      Set temp_setA = findFreeVars(temp.getPolicyA(), new HashSet<Object>());

      Set temp_setB = findFreeVars(temp.getPolicyB(), new HashSet<Object>());

      free_vars.addAll(temp_setA);

      free_vars.addAll(temp_setB);

    }

   

    else if (policy instanceof Disjunction){

      Disjunction temp = (Disjunction) policy;

     

      Set temp_setA = findFreeVars(temp.getPolicyA(), new HashSet<Object>());

      Set temp_setB = findFreeVars(temp.getPolicyB(), new HashSet<Object>());

      free_vars.addAll(temp_setA);

      free_vars.addAll(temp_setB);

    }

   

    else if (policy instanceof Box){

      Box temp = (Box) policy;

      findFreeVars(temp.getPolicy(), free_vars);

    }

   

    else if (policy instanceof Diamond){

      Diamond temp = (Diamond) policy;

      free_vars = findFreeVars(temp.getPolicy(), free_vars);

    }

   

    else if (policy instanceof Bind){

      Bind temp = (Bind) policy;

      findFreeVars(temp.getPolicy(), free_vars);

      free_vars.remove(temp.getVariable());

    }

   

    else if (policy instanceof At){

      At temp = (At) policy;

      findFreeVars(temp.getPolicy(), free_vars);

      free_vars.add(temp.getVariable());

    }

    return free_vars;
View Full Code Here

TOP

Related Classes of ca.ucalgary.ispia.rebac.Variable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.