Package ca.ucalgary.ispia.rebac.impl

Examples of ca.ucalgary.ispia.rebac.impl.DisjunctionImpl


   
    else if (tPolicy instanceof DisjunctionImpl){
      // Disjunction(policyA, policyB) =
      //  Negation(Conjunction((Negation(policyA)), (Negation(policyB))))
     
      DisjunctionImpl temp = (DisjunctionImpl) tPolicy;
      // Get contained fields
      Policy tempA = temp.getPolicyA();
      Policy tempB = temp.getPolicyB();
      // Translate contained policies
      tempA = new NegationImpl (translate(tempA));
      tempB = new NegationImpl (translate(tempB));
      // Create translated policy
      Policy tempC = new ConjunctionImpl(tempA, tempB);
      translatedPolicy = new NegationImpl (tempC);
     
    }
   
    else if (tPolicy instanceof BoxImpl){
      // Box(policy) = Negation(Diamond(Negation(policy)))

      BoxImpl temp = (BoxImpl) tPolicy;
     
      // Get contained fields
      Policy tempA = temp.getPolicy();
      Object relationID = temp.getRelationIdentifier();
      Direction direction = temp.getDirection();
      // Translate contained policy
      tempA = new NegationImpl (translate(tempA));
      // Create translated policy
      Policy tempB = new DiamondImpl(tempA, relationID, direction);   
      translatedPolicy = new NegationImpl (tempB);
    }
   
    else if (tPolicy instanceof DiamondImpl){
      // Already primitive. Recurse on contained policy.
     
      DiamondImpl temp = (DiamondImpl) tPolicy;
      // Get contained fields
      Policy tempA = temp.getPolicy();
      Object relationID = temp.getRelationIdentifier();
      Direction direction = temp.getDirection();
      // Translate contained policy
      tempA = translate(tempA);
      // Create translated policy
      translatedPolicy = new DiamondImpl(tempA, relationID, direction);
    }
   
    else if (tPolicy instanceof BindImpl){
      //Already primitive. Recurse on contained policy
     
      BindImpl temp= (BindImpl) tPolicy;
      Policy tempA = temp.getPolicy();
      Object var = temp.getVariable();
     
      //translate contained policy
      tempA=translate(tempA);
      // Create translated policy
      translatedPolicy = new BindImpl(var, tempA);
    }
   
    else if (tPolicy instanceof AtImpl){
      //Already primitive. Recurse on contained policy
     
      AtImpl temp = (AtImpl) tPolicy;
      Policy tempA = temp.getPolicy();
      Object var = temp.getVariable();
     
      //translate contained policy
      tempA=translate(tempA);
      // Create translated policy
      translatedPolicy = new AtImpl(var, tempA);
View Full Code Here


      free_vars.addAll(temp_setA);
      free_vars.addAll(temp_setB);
    }
   
    else if (policy instanceof DisjunctionImpl){
      DisjunctionImpl temp = (DisjunctionImpl) 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 BoxImpl){
      BoxImpl temp = (BoxImpl) policy;
      findFreeVars(temp.getPolicy(), free_vars);
    }
   
    else if (policy instanceof DiamondImpl){
      DiamondImpl temp = (DiamondImpl) policy;
      free_vars = findFreeVars(temp.getPolicy(), free_vars);
    }
   
    else if (policy instanceof BindImpl){
      BindImpl temp = (BindImpl) policy;
      findFreeVars(temp.getPolicy(), free_vars);
      free_vars.remove(temp.getVariable());
    }
   
    else if (policy instanceof AtImpl){
      AtImpl temp = (AtImpl) policy;
      findFreeVars(temp.getPolicy(), free_vars);
      free_vars.add(temp.getVariable());
    }
    return free_vars;
  }
View Full Code Here

        Policy tempB = temp.policyB;
        // Translate contained policies
        tempA = new NegationImpl (translate(tempA));
        tempB = new NegationImpl (translate(tempB));
        // Create translated policy
        Policy tempC = new DisjunctionImpl(tempA, tempB);
        translatedPolicy = new NegationImpl (tempC);
       
      }
         
      else if (tPolicy instanceof DiamondImpl){
        // Already primitive. Recurse on contained policy.
       
        DiamondImpl temp = (DiamondImpl) tPolicy;
        // Get contained fields
        Policy tempA = temp.policy;
        Object relationID = temp.relationIdentifier;
        Direction direction = temp.direction;
        // Translate contained policy
        tempA = translate(tempA);
        // Create translated policy
        translatedPolicy = new DiamondImpl(tempA, relationID, direction);
      }
         
      else if (tPolicy instanceof DisjunctionImpl){
        // Already primitive. Recurse on contained policies.
       
        DisjunctionImpl temp = (DisjunctionImpl) tPolicy;
        // Get contained fields
        Policy tempA = temp.policyA;
        Policy tempB = temp.policyB;
        // Translate contained fields
        tempA = translate(tempA);
        tempB = translate(tempB);
        // Create translated policy
        translatedPolicy = new DisjunctionImpl(tempA, tempB);
      }
     
      else if (tPolicy == FalseImpl.getInstance()){
        // False = Negation(True)
       
View Full Code Here

        // If element represents "and" variant, then create new Conjunction object
        newPolicy = new ConjunctionImpl(policyA, policyB);
      }
      else {
        // Else element represents "or" variant, create new Disjunction object
        newPolicy = new DisjunctionImpl(policyA, policyB);
      }
    }
    else if (element.getNodeName().equals("not")){
      // element represents "not" (negation) variant
     
View Full Code Here

      //  Negation(Conjunction((Negation(policyA)), (Negation(policyB))))

     

      DisjunctionImpl temp = (DisjunctionImpl) tPolicy;

      // Get contained fields

      Policy tempA = temp.getPolicyA();

      Policy tempB = temp.getPolicyB();

      // Translate contained policies

      tempA = new NegationImpl (translate(tempA));

      tempB = new NegationImpl (translate(tempB));

      // Create translated policy

      Policy tempC = new ConjunctionImpl(tempA, tempB);

      translatedPolicy = new NegationImpl (tempC);

     

    }

   

    else if (tPolicy instanceof BoxImpl){

      // Box(policy) = Negation(Diamond(Negation(policy)))



      BoxImpl temp = (BoxImpl) tPolicy;

     

      // Get contained fields

      Policy tempA = temp.getPolicy();

      Object relationID = temp.getRelationIdentifier();

      Direction direction = temp.getDirection();

      // Translate contained policy

      tempA = new NegationImpl (translate(tempA));

      // Create translated policy

      Policy tempB = new DiamondImpl(tempA, relationID, direction);   

      translatedPolicy = new NegationImpl (tempB);

    }

   

    else if (tPolicy instanceof DiamondImpl){

      // Already primitive. Recurse on contained policy.

     

      DiamondImpl temp = (DiamondImpl) tPolicy;

      // Get contained fields

      Policy tempA = temp.getPolicy();

      Object relationID = temp.getRelationIdentifier();

      Direction direction = temp.getDirection();

      // Translate contained policy

      tempA = translate(tempA);

      // Create translated policy

      translatedPolicy = new DiamondImpl(tempA, relationID, direction);

    }

   

    else if (tPolicy instanceof BindImpl){

      //Already primitive. Recurse on contained policy

     

      BindImpl temp= (BindImpl) tPolicy;

      Policy tempA = temp.getPolicy();

      Object var = temp.getVariable();

     

      //translate contained policy

      tempA=translate(tempA);

      // Create translated policy

      translatedPolicy = new BindImpl(var, tempA);

    }

   

    else if (tPolicy instanceof AtImpl){

      //Already primitive. Recurse on contained policy

     

      AtImpl temp = (AtImpl) tPolicy;

      Policy tempA = temp.getPolicy();

      Object var = temp.getVariable();

     

      //translate contained policy
View Full Code Here

   

    else if (policy instanceof DisjunctionImpl){

      DisjunctionImpl temp = (DisjunctionImpl) 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 BoxImpl){

      BoxImpl temp = (BoxImpl) policy;

      findFreeVars(temp.getPolicy(), free_vars);

    }

   

    else if (policy instanceof DiamondImpl){

      DiamondImpl temp = (DiamondImpl) policy;

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

    }

   

    else if (policy instanceof BindImpl){

      BindImpl temp = (BindImpl) policy;

      findFreeVars(temp.getPolicy(), free_vars);

      free_vars.remove(temp.getVariable());

    }

   

    else if (policy instanceof AtImpl){

      AtImpl temp = (AtImpl) policy;

      findFreeVars(temp.getPolicy(), free_vars);

      free_vars.add(temp.getVariable());

    }

    return free_vars;
View Full Code Here

        // If element represents "and" variant, then create new Conjunction object
        newPolicy = new ConjunctionImpl(policyA, policyB);
      }
      else {
        // Else element represents "or" variant, create new Disjunction object
        newPolicy = new DisjunctionImpl(policyA, policyB);
      }
    }
    else if (element.getNodeName().equals("not")){
      // element represents "not" (negation) variant
     
View Full Code Here

      //  Negation(Conjunction((Negation(policyA)), (Negation(policyB))))

     

      DisjunctionImpl temp = (DisjunctionImpl) tPolicy;

      // Get contained fields

      Policy tempA = temp.getPolicyA();

      Policy tempB = temp.getPolicyB();

      // Translate contained policies

      tempA = new NegationImpl (translate(tempA));

      tempB = new NegationImpl (translate(tempB));

      // Create translated policy

      Policy tempC = new ConjunctionImpl(tempA, tempB);

      translatedPolicy = new NegationImpl (tempC);

     

    }

   

    else if (tPolicy instanceof BoxImpl){

      // Box(policy) = Negation(Diamond(Negation(policy)))



      BoxImpl temp = (BoxImpl) tPolicy;

     

      // Get contained fields

      Policy tempA = temp.getPolicy();

      Object relationID = temp.getRelationIdentifier();

      Direction direction = temp.getDirection();

      // Translate contained policy

      tempA = new NegationImpl (translate(tempA));

      // Create translated policy

      Policy tempB = new DiamondImpl(tempA, relationID, direction);   

      translatedPolicy = new NegationImpl (tempB);

    }

   

    else if (tPolicy instanceof DiamondImpl){

      // Already primitive. Recurse on contained policy.

     

      DiamondImpl temp = (DiamondImpl) tPolicy;

      // Get contained fields

      Policy tempA = temp.getPolicy();

      Object relationID = temp.getRelationIdentifier();

      Direction direction = temp.getDirection();

      // Translate contained policy

      tempA = translate(tempA);

      // Create translated policy

      translatedPolicy = new DiamondImpl(tempA, relationID, direction);

    }

   

    else if (tPolicy instanceof BindImpl){

      //Already primitive. Recurse on contained policy

     

      BindImpl temp= (BindImpl) tPolicy;

      Policy tempA = temp.getPolicy();

      Object var = temp.getVariable();

     

      //translate contained policy

      tempA=translate(tempA);

      // Create translated policy

      translatedPolicy = new BindImpl(var, tempA);

    }

   

    else if (tPolicy instanceof AtImpl){

      //Already primitive. Recurse on contained policy

     

      AtImpl temp = (AtImpl) tPolicy;

      Policy tempA = temp.getPolicy();

      Object var = temp.getVariable();

     

      //translate contained policy
View Full Code Here

        // If element represents "and" variant, then create new Conjunction object
        newPolicy = new ConjunctionImpl(policyA, policyB);
      }
      else {
        // Else element represents "or" variant, create new Disjunction object
        newPolicy = new DisjunctionImpl(policyA, policyB);
      }
    }
    else if (element.getNodeName().equals("not")){
      // element represents "not" (negation) variant
     
View Full Code Here

TOP

Related Classes of ca.ucalgary.ispia.rebac.impl.DisjunctionImpl

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.