Package org.openntf.formula.impl

Examples of org.openntf.formula.impl.UserDefinedFunction


    //    The second to (n-1) child not of this node are optional and declares parameter variables used in this formula. (Here "x" and "y"
    //   
    int functionVariables = 0;
    ASTUserDefinedFunctionDef def = (ASTUserDefinedFunctionDef) children[0];

    UserDefinedFunction function = def.getFunction();

    for (int i = 1; i < children.length; i++) {
      if (children[i] instanceof ASTUserDefinedFunctionVariable) {
        functionVariables++;
      } else {
        function.setFunction(children[i]);
      }
    }

    ASTUserDefinedFunctionVariable[] var = new ASTUserDefinedFunctionVariable[functionVariables];
    for (int i = 0; i < functionVariables; i++) {
      var[i] = (ASTUserDefinedFunctionVariable) children[i + 1];
    }

    function.setVariables(var);

  }
View Full Code Here


    for (int i = 0; i < functionParameters; i++) {
      parameter[i] = (ASTUserDefinedFunctionParameter) children[i];
    }

    function = new UserDefinedFunction(functionName, parameter, parser);
    parser.declareFunction(function);
  }
View Full Code Here

TOP

Related Classes of org.openntf.formula.impl.UserDefinedFunction

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.