Examples of AbstractFunctionPtg


Examples of org.apache.poi.hssf.record.formula.AbstractFunctionPtg

    // the name gets encoded as the first arg
    NamePtg tname = (NamePtg) ptg[0];
    assertEquals("myFunc", tname.toFormulaString(book));

    AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[1];
    assertTrue(tfunc.isExternalFunction());
  }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.AbstractFunctionPtg

    token.setClass(transformClass(token.getPtgClass(), desiredOperandClass, callerForceArrayFlag));
  }

  private static boolean isSimpleValueFunction(Ptg token) {
    if (token instanceof AbstractFunctionPtg) {
      AbstractFunctionPtg aptg = (AbstractFunctionPtg) token;
      if (aptg.getDefaultOperandClass() != Ptg.CLASS_VALUE) {
        return false;
      }
      int numberOfOperands = aptg.getNumberOfOperands();
      for (int i=numberOfOperands-1; i>=0; i--) {
        if (aptg.getParameterClass(i) != Ptg.CLASS_VALUE) {
          return false;
        }
      }
      return true;
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.AbstractFunctionPtg

        Workbook w = new Workbook();
        FormulaParser fp = new FormulaParser("FOO()", w);
        fp.parse();
        Ptg[] ptg = fp.getRPNPtg();

        AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[0];
        assertEquals("externalflag", tfunc.getName());

        NamePtg tname = (NamePtg) ptg[1];
        assertEquals("FOO", tname.toFormulaString(w));
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.AbstractFunctionPtg

        Workbook w = new Workbook();
        FormulaParser fp = new FormulaParser("FOO()", w);
        fp.parse();
        Ptg[] ptg = fp.getRPNPtg();

        AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[0];
        assertEquals("externalflag", tfunc.getName());

        NamePtg tname = (NamePtg) ptg[1];
        assertEquals("FOO", tname.toFormulaString(w));
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.AbstractFunctionPtg

        Workbook w = new Workbook();
        FormulaParser fp = new FormulaParser("FOO()", w);
        fp.parse();
        Ptg[] ptg = fp.getRPNPtg();

        AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[0];
        assertEquals("externalflag", tfunc.getName());

        NamePtg tname = (NamePtg) ptg[1];
        assertEquals("FOO", tname.toFormulaString(w));
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.AbstractFunctionPtg

        Workbook w = new Workbook();
        FormulaParser fp = new FormulaParser("FOO()", w);
        fp.parse();
        Ptg[] ptg = fp.getRPNPtg();

        AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[0];
        assertEquals("externalflag", tfunc.getName());

        NamePtg tname = (NamePtg) ptg[1];
        assertEquals("FOO", tname.toFormulaString(w));
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.AbstractFunctionPtg

    // the name gets encoded as the first arg
    NamePtg tname = (NamePtg) ptg[0];
    assertEquals("myFunc", tname.toFormulaString(book));

    AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[1];
    assertTrue(tfunc.isExternalFunction());
  }
View Full Code Here

Examples of org.apache.poi.ss.formula.ptg.AbstractFunctionPtg

      return true;
    }

    // next 2 are special cases of OperationPtg
    if (tkn instanceof AbstractFunctionPtg) {
      AbstractFunctionPtg afp = (AbstractFunctionPtg) tkn;
      byte returnClass = afp.getDefaultOperandClass();
      return Ptg.CLASS_REF == returnClass;
    }
    if (tkn instanceof ValueOperatorPtg) {
      return false;
    }
View Full Code Here

Examples of org.apache.poi.ss.formula.ptg.AbstractFunctionPtg

      return new ParseNode(AttrPtg.getSumSingle(), args);
      // The code below would encode tFuncVar(SUM) which seems to do no harm
    }
    validateNumArgs(args.length, fm);

    AbstractFunctionPtg retval;
    if(isVarArgs) {
      retval = FuncVarPtg.create(name, numArgs);
    } else {
      retval = FuncPtg.create(funcIx);
    }
View Full Code Here

Examples of org.apache.poi.ss.formula.ptg.AbstractFunctionPtg

    // the name gets encoded as the first arg
    NamePtg tname = (NamePtg) ptg[0];
    assertEquals("myFunc", tname.toFormulaString(book));

    AbstractFunctionPtg tfunc = (AbstractFunctionPtg) ptg[1];
    assertTrue(tfunc.isExternalFunction());
  }
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.