Examples of VariableImpl


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

 
  @SuppressWarnings({ "rawtypes", "unchecked" })
  public static Set findFreeVars(Policy policy, Set free_vars){
   
    if (policy instanceof VariableImpl) {
      VariableImpl temp = (VariableImpl) policy;
      free_vars.add(temp.getVariable());
    }
    else if (policy == FalseImpl.getInstance()){
      //nothing added
    }
    else if (policy ==TrueImpl.getInstance()){
      //nothing added
    }
   
    else if(policy instanceof NegationImpl){
      NegationImpl temp = (NegationImpl) policy;
      findFreeVars(temp.getPolicy(), free_vars);
    }
   
    else if (policy instanceof ConjunctionImpl){
      ConjunctionImpl temp = (ConjunctionImpl) 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 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

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

    }

    else if (tPolicy instanceof OwnerImpl){
   
      //Translate the Owner variant to a variable
      translatedPolicy = new VariableImpl(Constants.owner);
     
    }
    else if (tPolicy instanceof RequestorImpl){
   
      //Translate the Requestor variant to a variable
      translatedPolicy = new VariableImpl(Constants.requestor);
    }

    else if (tPolicy == FalseImpl.getInstance()){

      // Already primitive
View Full Code Here

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

   

    if (policy instanceof VariableImpl) {

      VariableImpl temp = (VariableImpl) policy;

      free_vars.add(temp.getVariable());

    }

    else if (policy == FalseImpl.getInstance()){

      //nothing added

    }

    else if (policy ==TrueImpl.getInstance()){

      //nothing added

    }

   

    else if(policy instanceof NegationImpl){

      NegationImpl temp = (NegationImpl) policy;

      findFreeVars(temp.getPolicy(), free_vars);

    }

   

    else if (policy instanceof ConjunctionImpl){

      ConjunctionImpl temp = (ConjunctionImpl) 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 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

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

      newPolicy = OwnerImpl.getInstance();
    }
    else if (element.getNodeName().equals("variable")){ 
      Object temp=null;
      temp = new String (element.getFirstChild().getNodeValue());
      newPolicy = new VariableImpl(temp);
    }
    else if (element.getNodeName().equals("at")||element.getNodeName().equals("bind")){
      Policy policyA = null;
      Object variable = null;
     
View Full Code Here

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

    }

    else if (tPolicy instanceof OwnerImpl){
   
      //Translate the Owner variant to a variable
      translatedPolicy = new VariableImpl(Constants.owner);
     
    }
    else if (tPolicy instanceof RequestorImpl){
   
      //Translate the Requestor variant to a variable
      translatedPolicy = new VariableImpl(Constants.requestor);
    }
    else if (tPolicy instanceof ResourceImpl){
      //Translate the Resource variant to ta variable
      translatedPolicy = new VariableImpl(Constants.resource);
    }

    else if (tPolicy == FalseImpl.getInstance()){

      // Already primitive
View Full Code Here

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

      newPolicy = FalseImpl.getInstance();
    }
    else if (element.getNodeName().equals("variable")){ 
      Object temp=null;
      temp = new String (element.getFirstChild().getNodeValue());
      newPolicy = new VariableImpl(temp);
    }
    else if (element.getNodeName().equals("at")||element.getNodeName().equals("bind")){
      Policy policyA = null;
      Object variable = null;
     
View Full Code Here

Examples of org.exist.debugger.model.VariableImpl

    //XXX: handle errors
    List<Variable> variables = new ArrayList<Variable>();
   
    NodeList children = response.getElemetsByName("property");
    for (int i = 0; i < children.getLength(); i++) {
      variables.add(new VariableImpl(children.item(i)));
    }


    return variables;
  }
View Full Code Here

Examples of org.exist.xquery.VariableImpl

                                switch (_child.getNodeType()) {
                                case Node.ELEMENT_NODE:
                                    nodeName = ((ElementImpl) _child).getLocalName();
                                    if (nodeName.equals("param")) {
                                        el = ((ElementImpl) _child);
                                        Variable var = new VariableImpl(QName.parse(context, el.getAttribute("name")));

                                        String type = el.getAttribute("as");
                                        if ("xs:date".equals(type)) {
                                            var.setStaticType(Type.DATE);

                                            Sequence res = xquery.execute(el.getAttribute("select"), null, AccessContext.TEST);
                                            Assert.assertEquals(1, res.getItemCount());
                                            var.setValue(res);
                                        } else if ("xs:dateTime".equals(type)) {
                                            var.setStaticType(Type.DATE_TIME);

                                            Sequence res = xquery.execute(el.getAttribute("select"), null, AccessContext.TEST);
                                            Assert.assertEquals(1, res.getItemCount());
                                            var.setValue(res);
                                        } else if ("xs:string".equals(type)) {
                                            var.setStaticType(Type.STRING);

                                            Sequence res = xquery.execute(el.getAttribute("select"), null, AccessContext.TEST);
                                            Assert.assertEquals(1, res.getItemCount());
                                            var.setValue(res);
                                        } else {
                                            Assert.fail("unknown type '" + type + "'");
                                        }
                                        context.declareGlobalVariable(var);
                                    }
View Full Code Here

Examples of org.hisrc.jscm.codemodel.expression.impl.VariableImpl

  public FunctionDeclarationImpl(JSCodeModel codeModel, String name) {
    Validate.notNull(codeModel);
    Validate.notNull(name);
    this.codeModel = codeModel;
    this.name = name;
    this.functionExpression = new VariableImpl(codeModel, name);
    this.body = new FunctionBodyImpl(codeModel);
  }
View Full Code Here

Examples of org.hisrc.jscm.codemodel.expression.impl.VariableImpl

    return unmodifiableParameters;
  }

  public JSVariable parameter(String name) {
    Validate.notNull(name);
    JSVariable parameter = new VariableImpl(getCodeModel(), name);
    this.parameters.add(parameter);
    return parameter;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.