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

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


                break;
            }
        }
       
        if (retval == null) {
            retval = new StringEval(sb.toString());
        }
       
        return retval;
    }
View Full Code Here


                BoolEval be = (BoolEval) eval;
                retval = new CellValue(HSSFCell.CELL_TYPE_BOOLEAN);
                retval.setBooleanValue(be.getBooleanValue());
            }
            else if (eval instanceof StringEval) {
                StringEval ne = (StringEval) eval;
                retval = new CellValue(HSSFCell.CELL_TYPE_STRING);
                retval.setStringValue(ne.getStringValue());
            }
            else if (eval instanceof BlankEval) {
                retval = new CellValue(HSSFCell.CELL_TYPE_BLANK);
            }
            else if (eval instanceof ErrorEval) {
View Full Code Here

        }
        switch (cell.getCellType()) {
            case HSSFCell.CELL_TYPE_NUMERIC:
                return new NumberEval(cell.getNumericCellValue());
            case HSSFCell.CELL_TYPE_STRING:
                return new StringEval(cell.getRichStringCellValue().getString());
            case HSSFCell.CELL_TYPE_FORMULA:
                return internalEvaluate(cell, row, sheet, workbook);
            case HSSFCell.CELL_TYPE_BOOLEAN:
                return BoolEval.valueOf(cell.getBooleanCellValue());
            case HSSFCell.CELL_TYPE_BLANK:
View Full Code Here

       
        switch (cell.getCellType()) {
            case HSSFCell.CELL_TYPE_NUMERIC:
                return new Ref2DEval(ptg, new NumberEval(cell.getNumericCellValue()));
            case HSSFCell.CELL_TYPE_STRING:
                return new Ref2DEval(ptg, new StringEval(cell.getRichStringCellValue().getString()));
            case HSSFCell.CELL_TYPE_FORMULA:
                return new Ref2DEval(ptg, internalEvaluate(cell, row, sheet, workbook));
            case HSSFCell.CELL_TYPE_BOOLEAN:
                return new Ref2DEval(ptg, BoolEval.valueOf(cell.getBooleanCellValue()));
            case HSSFCell.CELL_TYPE_BLANK:
View Full Code Here

        }
        switch (cell.getCellType()) {
            case HSSFCell.CELL_TYPE_NUMERIC:
                return new Ref3DEval(ptg, new NumberEval(cell.getNumericCellValue()));
            case HSSFCell.CELL_TYPE_STRING:
                return new Ref3DEval(ptg, new StringEval(cell.getRichStringCellValue().getString()));
            case HSSFCell.CELL_TYPE_FORMULA:
                return new Ref3DEval(ptg, internalEvaluate(cell, row, sheet, workbook));
            case HSSFCell.CELL_TYPE_BOOLEAN:
                return new Ref3DEval(ptg, BoolEval.valueOf(cell.getBooleanCellValue()));
            case HSSFCell.CELL_TYPE_BLANK:
View Full Code Here

    int cellType = cell.getCellType();
    switch (cellType) {
      case Cell.CELL_TYPE_NUMERIC:
        return new NumberEval(cell.getNumericCellValue());
      case Cell.CELL_TYPE_STRING:
        return new StringEval(cell.getStringCellValue());
      case Cell.CELL_TYPE_BOOLEAN:
        return BoolEval.valueOf(cell.getBooleanCellValue());
      case Cell.CELL_TYPE_BLANK:
        return BlankEval.instance;
      case Cell.CELL_TYPE_ERROR:
View Full Code Here

    }
    if (ptg instanceof NumberPtg) {
      return new NumberEval(((NumberPtg)ptg).getValue());
    }
    if (ptg instanceof StringPtg) {
      return new StringEval(((StringPtg) ptg).getValue());
    }
    if (ptg instanceof BoolPtg) {
      return BoolEval.valueOf(((BoolPtg) ptg).getValue());
    }
    if (ptg instanceof ErrPtg) {
View Full Code Here

    // Error handling for lookup_range arg is also unusual
    if(eval instanceof NumericValueEval) {
      throw new EvaluationException(ErrorEval.NA);
    }
    if (eval instanceof StringEval) {
      StringEval se = (StringEval) eval;
      Double d = OperandResolver.parseDouble(se.getStringValue());
      if(d == null) {
        // plain string
        throw new EvaluationException(ErrorEval.VALUE_INVALID);
      }
      // else looks like a number
View Full Code Here

    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) {
        // plain string
        throw new EvaluationException(ErrorEval.VALUE_INVALID);
      }
      // if the string parses as a number, it is OK
View Full Code Here

      if (_isLeft) {
        result = arg.substring(0, Math.min(arg.length(), index));
      } else {
        result = arg.substring(Math.max(0, arg.length()-index));
      }
      return new StringEval(result);
    }
View Full Code Here

TOP

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

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.