private static TwoDEval convertFirstArg(ValueEval arg0) { if (arg0 instanceof RefEval) { // convert to area ref for simpler code in getValueFromArea() return ((RefEval) arg0).offset(0, 0, 0, 0); } if((arg0 instanceof TwoDEval)) { return (TwoDEval) arg0; } // else the other variation of this function takes an array as the first argument // it seems like interface 'ArrayEval' does not even exist yet throw new RuntimeException("Incomplete code - cannot handle first arg of type (" + arg0.getClass().getName() + ")"); }
private static AreaEval convertRangeArg(ValueEval eval) throws EvaluationException { if (eval instanceof AreaEval) { return (AreaEval) eval; } if (eval instanceof RefEval) { return ((RefEval)eval).offset(0, 0, 0, 0); } throw new EvaluationException(ErrorEval.VALUE_INVALID); }
public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx) { if (_refEval == null) { return _areaEval.offset(relFirstRowIx, relLastRowIx, relFirstColIx, relLastColIx); } return _refEval.offset(relFirstRowIx, relLastRowIx, relFirstColIx, relLastColIx); } }
private static AreaEval convertRangeArg(ValueEval eval) throws EvaluationException { if (eval instanceof AreaEval) { return (AreaEval) eval; } if (eval instanceof RefEval) { return ((RefEval)eval).offset(0, 0, 0, 0); } throw new EvaluationException(ErrorEval.VALUE_INVALID); }
protected static AreaEval convertRangeArg(ValueEval eval) throws EvaluationException { if (eval instanceof AreaEval) { return (AreaEval) eval; } if (eval instanceof RefEval) { return ((RefEval)eval).offset(0, 0, 0, 0); } throw new EvaluationException(ErrorEval.VALUE_INVALID); }
private static AreaEval evaluateRef(ValueEval arg) throws EvaluationException { if (arg instanceof AreaEval) { return (AreaEval) arg; } if (arg instanceof RefEval) { return ((RefEval) arg).offset(0, 0, 0, 0); } if (arg instanceof ErrorEval) { throw new EvaluationException((ErrorEval)arg); } throw new IllegalArgumentException("Unexpected ref arg class (" + arg.getClass().getName() + ")"); } }
private static AreaEval evaluateRef(ValueEval arg) throws EvaluationException { if (arg instanceof AreaEval) { return (AreaEval) arg; } if (arg instanceof RefEval) { return ((RefEval) arg).offset(0, 0, 0, 0); } if (arg instanceof ErrorEval) { throw new EvaluationException((ErrorEval)arg); } throw new IllegalArgumentException("Unexpected ref arg class (" + arg.getClass().getName() + ")"); } }
/** * The second argument (table_array) should be an area ref, but can actually be a cell ref, in * which case it is interpreted as a 1x1 area ref. Other scalar values cause #VALUE! error. */ public static TwoDEval resolveTableArrayArg(ValueEval eval) throws EvaluationException { if (eval instanceof TwoDEval) { return (TwoDEval) 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(); }
/** * @return a range of the same dimensions as aeRange using eval to define the top left corner. * @throws EvaluationException if eval is not a reference */ private static AreaEval createSumRange(ValueEval eval, AreaEval aeRange) throws EvaluationException { if (eval instanceof AreaEval) { return ((AreaEval) eval).offset(0, aeRange.getHeight()-1, 0, aeRange.getWidth()-1); } if (eval instanceof RefEval) { return ((RefEval)eval).offset(0, aeRange.getHeight()-1, 0, aeRange.getWidth()-1); } throw new EvaluationException(ErrorEval.VALUE_INVALID); }
public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx) { if (_refEval == null) { return _areaEval.offset(relFirstRowIx, relLastRowIx, relFirstColIx, relLastColIx); } return _refEval.offset(relFirstRowIx, relLastRowIx, relFirstColIx, relLastColIx); } }
public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx) { if (_refEval == null) { return _areaEval.offset(relFirstRowIx, relLastRowIx, relFirstColIx, relLastColIx); } return _refEval.offset(relFirstRowIx, relLastRowIx, relFirstColIx, relLastColIx); } }
protected static AreaEval convertRangeArg(ValueEval eval) throws EvaluationException { if (eval instanceof AreaEval) { return (AreaEval) eval; } if (eval instanceof RefEval) { return ((RefEval)eval).offset(0, 0, 0, 0); } throw new EvaluationException(ErrorEval.VALUE_INVALID); }
private static AreaEval convertRangeArg(ValueEval eval) throws EvaluationException { if (eval instanceof AreaEval) { return (AreaEval) eval; } if (eval instanceof RefEval) { return ((RefEval)eval).offset(0, 0, 0, 0); } throw new EvaluationException(ErrorEval.VALUE_INVALID); }
public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx) { if (_refEval == null) { return _areaEval.offset(relFirstRowIx, relLastRowIx, relFirstColIx, relLastColIx); } return _refEval.offset(relFirstRowIx, relLastRowIx, relFirstColIx, relLastColIx); } }
private static AreaEval convertRangeArg(ValueEval eval) throws EvaluationException { if (eval instanceof AreaEval) { return (AreaEval) eval; } if (eval instanceof RefEval) { return ((RefEval)eval).offset(0, 0, 0, 0); } throw new EvaluationException(ErrorEval.VALUE_INVALID); }
private static AreaEval convertRangeArg(ValueEval eval) throws EvaluationException { if (eval instanceof AreaEval) { return (AreaEval) eval; } if (eval instanceof RefEval) { return ((RefEval)eval).offset(0, 0, 0, 0); } throw new EvaluationException(ErrorEval.VALUE_INVALID); }
private static AreaEval convertRangeArg(ValueEval eval) throws EvaluationException { if (eval instanceof AreaEval) { return (AreaEval) eval; } if (eval instanceof RefEval) { return ((RefEval)eval).offset(0, 0, 0, 0); } throw new EvaluationException(ErrorEval.VALUE_INVALID); }
private static AreaEval convertRangeArg(ValueEval eval) throws EvaluationException { if (eval instanceof AreaEval) { return (AreaEval) eval; } if (eval instanceof RefEval) { return ((RefEval)eval).offset(0, 0, 0, 0); } throw new EvaluationException(ErrorEval.VALUE_INVALID); }
private static AreaEval convertRangeArg(ValueEval eval) throws EvaluationException { if (eval instanceof AreaEval) { return (AreaEval) eval; } if (eval instanceof RefEval) { return ((RefEval)eval).offset(0, 0, 0, 0); } throw new EvaluationException(ErrorEval.VALUE_INVALID); }
/** * @return a range of the same dimensions as aeRange using eval to define the top left corner. * @throws EvaluationException if eval is not a reference */ private static AreaEval createSumRange(ValueEval eval, AreaEval aeRange) throws EvaluationException { if (eval instanceof AreaEval) { return ((AreaEval) eval).offset(0, aeRange.getHeight()-1, 0, aeRange.getWidth()-1); } if (eval instanceof RefEval) { return ((RefEval)eval).offset(0, aeRange.getHeight()-1, 0, aeRange.getWidth()-1); } throw new EvaluationException(ErrorEval.VALUE_INVALID); }