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

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


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


    }
  }

  private static ValueVector evaluateLookupRange(Eval 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

    if (eval instanceof AreaEval) {
      return (AreaEval) eval;
    }

    if(eval instanceof RefEval) {
      RefEval refEval = (RefEval) eval;
      // Make this cell ref look like a 1x1 area ref.

      // It doesn't matter if eval is a 2D or 3D ref, because that detail is never asked of AreaEval.
      return refEval.offset(0, 0, 0, 0);
    }
    throw EvaluationException.invalidValue();
  }
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

        if (eval instanceof AreaEval) {
            AreaEval ae = (AreaEval) eval;
            return countAreaEval(ae);
        }
        if (eval instanceof RefEval) {
            RefEval refEval = (RefEval)eval;
      return countValue(refEval.getInnerValueEval());
        }
        if (eval instanceof NumberEval) {
            return 1;
        }
        if (eval instanceof StringEval) {
View Full Code Here

    }
  }

  private static ValueEval[] evaluateLookupRange(Eval eval) throws EvaluationException {
    if (eval instanceof RefEval) {
      RefEval re = (RefEval) eval;
      return new ValueEval[] { re.getInnerValueEval(), };
    }
    if (eval instanceof AreaEval) {
      AreaEval ae = (AreaEval) eval;
      if(!ae.isColumn() && !ae.isRow()) {
        throw new EvaluationException(ErrorEval.NA);
View Full Code Here

        if (eval instanceof AreaEval) {
            AreaEval ae = (AreaEval) eval;
            return countAreaEval(ae);
        }
        if (eval instanceof RefEval) {
            RefEval refEval = (RefEval)eval;
      return countValue(refEval.getInnerValueEval());
        }
        if (eval instanceof NumberEval) {
            return 1;
        }
   
View Full Code Here

   */
  private static int convertIndexArgToZeroBase(Eval ev) {
    NumberEval ne;
    if(ev instanceof RefEval) {
      // TODO - write junit to justify this
      RefEval re = (RefEval) ev;
      ne = (NumberEval) re.getInnerValueEval();
    } else {
      ne = (NumberEval)ev;
    }
   
    return (int)ne.getNumberValue() - 1;
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 = new Ref2DEval(null, values[j]);
                ValueEval ve = singleOperandEvaluate(re, srcRow, srcCol);
               
                if (ve instanceof NumericValueEval) {
                    NumericValueEval nve = (NumericValueEval) ve;
                    retval.add(nve.getNumberValue());
View Full Code Here

            case 1:
                 break;
        }
        Eval arg = args[0];
        if (arg instanceof RefEval) {
            RefEval re = (RefEval) arg;
            arg = re.getInnerValueEval();
        }
       
        if (arg instanceof StringEval) {
            // Text values are returned unmodified
            return arg;
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.