Package org.apache.poi.hssf.record.formula.eval

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


            if (ve instanceof StringValueEval) {
                StringValueEval sve = (StringValueEval) ve;
                s = sve.getStringValue();
            }
            else if (ve instanceof RefEval) {
                RefEval re = (RefEval) ve;
                ValueEval ive = re.getInnerValueEval();
                if (ive instanceof BlankEval) {
                    s = re.isEvaluated() ? "0" : null;
                }
                else if (ive instanceof StringValueEval) {
                    s = ((StringValueEval) ive).getStringValue();
                }
                else if (ive instanceof BlankEval) {}
View Full Code Here


                 * For now this is a tempfix solution since this may
                 * require a more generic fix at the level of
                 * HSSFFormulaEvaluator where we store an array
                 * of RefEvals as the "values" array.
                 */
                RefEval re = (values[j] instanceof RefEval)
                        ? new Ref2DEval(null, ((RefEval) values[j]).getInnerValueEval(), true)
                        : new Ref2DEval(null, values[j], false);
                ValueEval ve = singleOperandEvaluate(re, srcRow, srcCol);
               
                if (ve instanceof NumericValueEval) {
View Full Code Here

                else {
                    b = false;
                }
            }
            else if (operands[0] instanceof RefEval) {
                RefEval re = (RefEval) operands[0];
                b = (!re.isEvaluated()) && re.getInnerValueEval() instanceof BlankEval;
            }
            else {
                b = false;
            }
        }
View Full Code Here

   
   
    protected ValueEval singleOperandEvaluate(Eval ve) {
        ValueEval retval = ErrorEval.VALUE_INVALID;
        if (ve instanceof RefEval) {
            RefEval re = (RefEval) ve;
            retval = singleOperandEvaluate(re.getInnerValueEval());
        }
        else if (ve instanceof BoolEval) {
            retval = (BoolEval) ve;
        }
        else if (ve instanceof NumberEval) {
View Full Code Here

       
        if (eval instanceof NumberEval) {
            retval = true;
        }
        else if (eval instanceof RefEval) {
            RefEval re = (RefEval) eval;
            ValueEval ve = re.getInnerValueEval();
            retval = (ve instanceof NumberEval);
        }
       
        return retval;
    }
View Full Code Here

        if (eval instanceof NumberEval) {
            NumberEval ne = (NumberEval) eval;
            retval = ne.getNumberValue();
        }
        else if (eval instanceof RefEval) {
            RefEval re = (RefEval) eval;
            ValueEval ve = re.getInnerValueEval();
                retval = (ve instanceof NumberEval)
                    ? ((NumberEval) ve).getNumberValue()
                    : Double.NaN;
        }
        else if (eval instanceof ErrorEval) {
View Full Code Here

   * @return a <tt>NumberEval</tt>, <tt>StringEval</tt>, <tt>BoolEval</tt>,
   *  <tt>BlankEval</tt> or <tt>ErrorEval</tt>. Never <code>null</code>.
     */
    private static ValueEval dereferenceValue(ValueEval evaluationResult, int srcRowNum, short srcColNum) {
        if (evaluationResult instanceof RefEval) {
            RefEval rv = (RefEval) evaluationResult;
            return rv.getInnerValueEval();
        }
        if (evaluationResult instanceof AreaEval) {
            AreaEval ae = (AreaEval) evaluationResult;
            if (ae.isRow()) {
                if(ae.isColumn()) {
View Full Code Here

   * @return a <tt>NumberEval</tt>, <tt>StringEval</tt>, <tt>BoolEval</tt>,
   *  <tt>BlankEval</tt> or <tt>ErrorEval</tt>. Never <code>null</code>.
   */
  private static ValueEval dereferenceValue(ValueEval evaluationResult, int srcRowNum, int srcColNum) {
    if (evaluationResult instanceof RefEval) {
      RefEval rv = (RefEval) evaluationResult;
      return rv.getInnerValueEval();
    }
    if (evaluationResult instanceof AreaEval) {
      AreaEval ae = (AreaEval) evaluationResult;
      if (ae.isRow()) {
        if(ae.isColumn()) {
View Full Code Here

        }
      }
      return;
    }
    if (operand instanceof RefEval) {
      RefEval re = (RefEval) operand;
      collectValue(re.getInnerValueEval(), true, temp);
      return;
    }
    collectValue(operand, false, temp);
  }
View Full Code Here

    }
  }

  private static ValueVector evaluateLookupRange(ValueEval eval) throws EvaluationException {
    if (eval instanceof RefEval) {
      RefEval re = (RefEval) eval;
      return new SingleValueVector(re.getInnerValueEval());
    }
    if (eval instanceof AreaEval) {
      ValueVector result = LookupUtils.createVector((AreaEval)eval);
      if (result == null) {
        throw new EvaluationException(ErrorEval.NA);
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.formula.eval.RefEval

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.