Package org.apache.poi.ss.formula.ptg

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


  public void testTooFewOperandArgs() {
    // Simulating badly encoded cell formula of "=/1"
    // Not sure if Excel could ever produce this
    Ptg[] ptgs = {
        // Excel would probably have put tMissArg here
        new IntPtg(1),
        DividePtg.instance,
    };
    try {
      toFormulaString(ptgs);
      fail("Expected exception was not thrown");
View Full Code Here


    assertTrue("IF Attr set correctly", (ptgs[3] instanceof AttrPtg));
    AttrPtg ifFunc = (AttrPtg)ptgs[3];
    assertTrue("It is not an if", ifFunc.isOptimizedIf());

    assertTrue("Single Value is not an IntPtg", (ptgs[4] instanceof IntPtg));
    IntPtg intPtg = (IntPtg)ptgs[4];
    assertEquals("Result", (short)10, intPtg.getValue());

    assertTrue("Ptg is not a Variable Function", (ptgs[6] instanceof FuncVarPtg));
    FuncVarPtg funcPtg = (FuncVarPtg)ptgs[6];
    assertEquals("Arguments", 2, funcPtg.getNumberOfOperands());
  }
View Full Code Here

   * the whole formula which converts tAttrSum to tFuncVar("SUM") )
   */
  public void testAttrSum() {

    Ptg[] ptgs = {
      new IntPtg(42),
      AttrPtg.SUM,
    };

    ValueEval result = evaluateFormula(ptgs);
    assertEquals(42, ((NumberEval)result).getNumberValue(), 0.0);
View Full Code Here

   * the whole formula which converts tAttrSum to tFuncVar("SUM") )
   */
  public void testMemFunc() {

    Ptg[] ptgs = {
      new IntPtg(42),
      AttrPtg.SUM,
    };

    ValueEval result = evaluateFormula(ptgs);
    assertEquals(42, ((NumberEval)result).getNumberValue(), 0.0);
View Full Code Here

TOP

Related Classes of org.apache.poi.ss.formula.ptg.IntPtg

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.