Examples of StringValueEval


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

            retval = ErrorEval.VALUE_INVALID;
            break;
        case 1:
            ValueEval ve = singleOperandEvaluate(operands[0], srcCellRow, srcCellCol);
            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) {
View Full Code Here

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

            retval = ErrorEval.VALUE_INVALID;
            break;
        case 1:
            ValueEval ve = singleOperandEvaluate(operands[0], srcCellRow, srcCellCol);
            if (ve instanceof StringValueEval) {
                StringValueEval sve = (StringValueEval) ve;
                s = sve.getStringValue();
            }
            else if (ve instanceof BlankEval) {}
            else {
                retval = ErrorEval.VALUE_INVALID;
                break;
View Full Code Here

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

            retval = ErrorEval.VALUE_INVALID;
            break;
        case 2:
            ValueEval ve = singleOperandEvaluate(operands[0], srcCellRow, srcCellCol);
            if (ve instanceof StringValueEval) {
                StringValueEval sve = (StringValueEval) ve;
                s0 = sve.getStringValue();
            }
            else if (ve instanceof BlankEval) {
                s0 = StringEval.EMPTY_INSTANCE.getStringValue();
            }
            else {
                retval = ErrorEval.VALUE_INVALID;
                break;
            }

            if (retval == null) {
                ve = singleOperandEvaluate(operands[1], srcCellRow, srcCellCol);
                if (ve instanceof StringValueEval) {
                    StringValueEval sve = (StringValueEval) ve;
                    s1 = sve.getStringValue();
                }
                else if (ve instanceof BlankEval) {
                    s1 = StringEval.EMPTY_INSTANCE.getStringValue();
                }
                else {
View Full Code Here

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

              ValueEval thirdveval = singleOperandEvaluate(operands[2], srcCellRow, srcCellCol);
              if (firstveval instanceof StringValueEval
                && secondveval instanceof NumericValueEval
                && thirdveval instanceof NumericValueEval) {
               
                  StringValueEval strEval = (StringValueEval) firstveval;
                  str = strEval.getStringValue();
                 
                  NumericValueEval startNumEval = (NumericValueEval) secondveval;
                  // NOTE: it is safe to cast to int here
                  // because in Excel =MID("test", 1, 1.7) returns t
                  // so 1.7 must be truncated to 1
View Full Code Here

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

          default:
              break;
          case 1:
              ValueEval veval = singleOperandEvaluate(operands[0], srcCellRow, srcCellCol);
              if (veval instanceof StringValueEval) {
                  StringValueEval sve = (StringValueEval) veval;
                  str = sve.getStringValue();
                  if (str == null || str.trim().equals("")) {
                    return BlankEval.INSTANCE;
                  }
              }
              else if (veval instanceof NumberEval) {
View Full Code Here

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

    if (eval instanceof NumericValueEval) {
      NumericValueEval ne = (NumericValueEval) eval;
      return new CellValue(ne.getNumberValue());
    }
    if (eval instanceof StringValueEval) {
      StringValueEval ne = (StringValueEval) 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.StringValueEval

    if (eval instanceof NumericValueEval) {
      NumericValueEval ne = (NumericValueEval) eval;
      return new CellValue(ne.getNumberValue());
    }
    if (eval instanceof StringValueEval) {
      StringValueEval ne = (StringValueEval) 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.StringValueEval

    if (eval instanceof NumericValueEval) {
      NumericValueEval ne = (NumericValueEval) eval;
      return new CellValue(ne.getNumberValue());
    }
    if (eval instanceof StringValueEval) {
      StringValueEval ne = (StringValueEval) 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
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.