Examples of NumberEval


Examples of org.apache.poi.hssf.record.formula.eval.NumberEval

            }
        }

        if (retval == null) {
            d = MathX.cosh(d);
            retval = (Double.isNaN(d) || Double.isInfinite(d)) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval(d);
        }
        return retval;
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.eval.NumberEval

       
        if (retval == null) {
            double d = MathX.sumx2py2(values[X], values[Y]);
            retval = (Double.isNaN(d) || Double.isInfinite(d))
                    ? (ValueEval) ErrorEval.NUM_ERROR
                    : new NumberEval(d);
        }
       
        return retval;
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.eval.NumberEval

            }
        }

        if (retval == null) {
            d = MathX.asinh(d);
            retval = (Double.isNaN(d)) ? (ValueEval) ErrorEval.NUM_ERROR : new NumberEval(d);
        }
        return retval;
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.eval.NumberEval

        }
        else if (ve instanceof BoolEval) {
            retval = (BoolEval) ve;
        }
        else if (ve instanceof NumberEval) {
            NumberEval ne = (NumberEval) ve;
            retval = ne.getNumberValue() != 0 ? BoolEval.TRUE : BoolEval.FALSE;
        }
        else if (ve instanceof StringEval) {
            StringEval se = (StringEval) ve;
            String str = se.getStringValue();
            retval = str.equalsIgnoreCase("true")
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.eval.NumberEval

        if (retval == null) {
            d = Math.asin(d);
            retval = (Double.isNaN(d))
                    ? (ValueEval) ErrorEval.NUM_ERROR
                    : new NumberEval(d);
        }
        return retval;
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.eval.NumberEval

            }
        }
       
        if (retval == null) {
            double d = Math.pow(d0, d1);
            retval = (Double.isNaN(d) || Double.isNaN(d)) ? (ValueEval) ErrorEval.VALUE_INVALID : new NumberEval(d);
        }
        return retval;
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.eval.NumberEval

        }
        else {
            double d = MathX.sumsq(values);
            retval = (Double.isNaN(d) || Double.isInfinite(d))
                    ? (ValueEval) ErrorEval.NUM_ERROR
                    : new NumberEval(d);
        }
       
        return retval;
    }
View Full Code Here

Examples of org.apache.poi.ss.formula.eval.NumberEval

   * @param eval
   */
  private CellValue evaluateFormulaCellValue(Cell cell) {
    ValueEval eval = _bookEvaluator.evaluate(new HSSFEvaluationCell((HSSFCell)cell));
    if (eval instanceof NumberEval) {
      NumberEval ne = (NumberEval) eval;
      return new CellValue(ne.getNumberValue());
    }
    if (eval instanceof BoolEval) {
      BoolEval be = (BoolEval) eval;
      return CellValue.valueOf(be.getBooleanValue());
    }
    if (eval instanceof StringEval) {
      StringEval ne = (StringEval) eval;
      return new CellValue(ne.getStringValue());
    }
    if (eval instanceof ErrorEval) {
      return CellValue.getError(((ErrorEval)eval).getErrorCode());
    }
    throw new RuntimeException("Unexpected eval class (" + eval.getClass().getName() + ")");
View Full Code Here

Examples of org.apache.poi.ss.formula.eval.NumberEval

      return BlankEval.instance;
    }
    int cellType = cell.getCellType();
    switch (cellType) {
      case Cell.CELL_TYPE_NUMERIC:
        return new NumberEval(cell.getNumericCellValue());
      case Cell.CELL_TYPE_STRING:
        return new StringEval(cell.getStringCellValue());
      case Cell.CELL_TYPE_BOOLEAN:
        return BoolEval.valueOf(cell.getBooleanCellValue());
      case Cell.CELL_TYPE_BLANK:
View Full Code Here

Examples of org.apache.poi.ss.formula.eval.NumberEval

    if (ptg instanceof NameXPtg) {
       return ec.getNameXEval(((NameXPtg) ptg));
    }

    if (ptg instanceof IntPtg) {
      return new NumberEval(((IntPtg)ptg).getValue());
    }
    if (ptg instanceof NumberPtg) {
      return new NumberEval(((NumberPtg)ptg).getValue());
    }
    if (ptg instanceof StringPtg) {
      return new StringEval(((StringPtg) ptg).getValue());
    }
    if (ptg instanceof BoolPtg) {
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.