Examples of NumericValueEval


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

            retval = ErrorEval.VALUE_INVALID;
            break;
        case 1:
            ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol);
            if (ve instanceof NumericValueEval) {
                NumericValueEval ne = (NumericValueEval) ve;
                d = ne.getNumberValue();
            }
            else if (ve instanceof BlankEval) {
                // do nothing
            }
            else {
View Full Code Here

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

            retval = ErrorEval.VALUE_INVALID;
            break;
        case 2:
            ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol);
            if (ve instanceof NumericValueEval) {
                NumericValueEval ne = (NumericValueEval) ve;
                d0 = ne.getNumberValue();
            }
            else if (ve instanceof BlankEval) {
                // do nothing
            }
            else {
                retval = ErrorEval.NUM_ERROR;
            }

            if (retval == null) {
                ve = singleOperandEvaluate(operands[1], srcRow, srcCol);
                if (ve instanceof NumericValueEval) {
                    NumericValueEval ne = (NumericValueEval) ve;
                    d1 = ne.getNumberValue();
                }
                else if (ve instanceof BlankEval) {
                    // do nothing
                }
                else {
View Full Code Here

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

            retval = ErrorEval.VALUE_INVALID;
            break;
        case 1:
            ValueEval ve = singleOperandEvaluate(operands[0], srcRow, srcCol);
            if (ve instanceof NumericValueEval) {
                NumericValueEval ne = (NumericValueEval) ve;
                d = ne.getNumberValue();
            }
            else if (ve instanceof BlankEval) {
                // do nothing
            }
            else {
View Full Code Here

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

    if(match_type instanceof ErrorEval) {
      throw new EvaluationException((ErrorEval)match_type);
    }
    if(match_type instanceof NumericValueEval) {
      NumericValueEval ne = (NumericValueEval) match_type;
      return ne.getNumberValue();
    }
    if (match_type instanceof StringEval) {
      StringEval se = (StringEval) match_type;
      Double d = OperandResolver.parseDouble(se.getStringValue());
      if(d == null) {
View Full Code Here

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

      // Note for area SUMPRODUCTs, string values are interpreted as zero
      // even if they would parse as valid numeric values
      return 0;
    }
    if(ve instanceof NumericValueEval) {
      NumericValueEval nve = (NumericValueEval) ve;
      return nve.getNumberValue();
    }
    throw new RuntimeException("Unexpected value eval class ("
        + ve.getClass().getName() + ")");
  }
View Full Code Here

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

      throw EvaluationException.invalidValue();
      // This is in contrast to the code below,, where NumberEvals values (for
      // example 0.01) *do* resolve to equivalent boolean values.
    }
    if (valEval instanceof NumericValueEval) {
      NumericValueEval nve = (NumericValueEval) valEval;
      // zero is FALSE, everything else is TRUE
      return 0.0 != nve.getNumberValue();
    }
    throw new RuntimeException("Unexpected eval type (" + valEval.getClass().getName() + ")");
  }
View Full Code Here

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

      // Note for area SUMPRODUCTs, string values are interpreted as zero
      // even if they would parse as valid numeric values
      return 0;
    }
    if(ve instanceof NumericValueEval) {
      NumericValueEval nve = (NumericValueEval) ve;
      return nve.getNumberValue();
    }
    throw new RuntimeException("Unexpected value eval class ("
        + ve.getClass().getName() + ")");
  }
View Full Code Here

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

    if(match_type instanceof ErrorEval) {
      throw new EvaluationException((ErrorEval)match_type);
    }
    if(match_type instanceof NumericValueEval) {
      NumericValueEval ne = (NumericValueEval) match_type;
      return ne.getNumberValue();
    }
    if (match_type instanceof StringEval) {
      StringEval se = (StringEval) match_type;
      Double d = OperandResolver.parseDouble(se.getStringValue());
      if(d == null) {
View Full Code Here

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

      throw EvaluationException.invalidValue();
      // This is in contrast to the code below,, where NumberEvals values (for
      // example 0.01) *do* resolve to equivalent boolean values.
    }
    if (valEval instanceof NumericValueEval) {
      NumericValueEval nve = (NumericValueEval) valEval;
      // zero is FALSE, everything else is TRUE
      return 0.0 != nve.getNumberValue();
    }
    throw new RuntimeException("Unexpected eval type (" + valEval.getClass().getName() + ")");
  }
View Full Code Here

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

      throw new NumericEvalEx("Result object type (" + evalResult.getClass().getName()
          + ") is invalid.  Expected implementor of ("
          + NumericValueEval.class.getName() + ")");
    }
   
    NumericValueEval result = (NumericValueEval) evalResult;
    return result.getNumberValue();
  }
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.