Package org.apache.poi.ss.util

Examples of org.apache.poi.ss.util.CellReference


        CellReference cf = new CellReference("$B5");
        confirmCell(cf, null, 4, 1, false, true, "$B5");
    }
   
    public void  testAbsRef6(){
        CellReference cf = new CellReference(4,1,false,true);
        confirmCell(cf, null, 4, 1, false, true, "$B5");
    }
View Full Code Here


        CellReference cf = new CellReference(4,1,false,true);
        confirmCell(cf, null, 4, 1, false, true, "$B5");
    }

    public void  testAbsRef7(){
        CellReference cf = new CellReference("B5");
        confirmCell(cf, null, 4, 1, false, false, "B5");
    }
View Full Code Here

        CellReference cf = new CellReference("B5");
        confirmCell(cf, null, 4, 1, false, false, "B5");
    }
   
    public void  testAbsRef8(){
        CellReference cf = new CellReference(4,1,false,false);
        confirmCell(cf, null, 4, 1, false, false, "B5");
    }
View Full Code Here

        CellReference cf = new CellReference(4,1,false,false);
        confirmCell(cf, null, 4, 1, false, false, "B5");
    }
   
    public void testSpecialSheetNames() {
        CellReference cf;
        cf = new CellReference("'profit + loss'!A1");
        confirmCell(cf, "profit + loss", 0, 0, false, false, "'profit + loss'!A1");
       
        cf = new CellReference("'O''Brien''s Sales'!A1");
        confirmCell(cf, "O'Brien's Sales", 0, 0, false, false, "'O''Brien''s Sales'!A1");
       
        cf = new CellReference("'Amazing!'!A1");
        confirmCell(cf, "Amazing!", 0, 0, false, false, "'Amazing!'!A1");
    }
View Full Code Here

        agg.setParsedExpression(ptgsForCell);
    }

    public CellRangeAddress getArrayFormulaRange() {
        if (_cellType != CELL_TYPE_FORMULA) {
            String ref = new CellReference(this).formatAsString();
            throw new IllegalStateException("Cell " + ref
                    + " is not part of an array formula.");
        }
        return ((FormulaRecordAggregate)_record).getArrayFormulaRange();
    }
View Full Code Here

     * @see org.apache.poi.hssf.usermodel.HSSFSheet#shiftRows(int, int, int)
     * @see org.apache.poi.hssf.usermodel.HSSFSheet#addMergedRegion(org.apache.poi.ss.util.CellRangeAddress)
     * @throws IllegalStateException if modification is not allowed
     */
    void notifyArrayFormulaChanging(){
        CellReference ref = new CellReference(this);
        String msg = "Cell "+ref.formatAsString()+" is part of a multi-cell array formula. " +
                "You cannot change part of an array.";
        notifyArrayFormulaChanging(msg);
    }
View Full Code Here

        if (cell.getSheet() != this) {
            throw new IllegalArgumentException("Specified cell does not belong to this sheet.");
        }
        CellValueRecordInterface rec = ((HSSFCell) cell).getCellValueRecord();
        if (!(rec instanceof FormulaRecordAggregate)) {
            String ref = new CellReference(cell).formatAsString();
            throw new IllegalArgumentException("Cell " + ref + " is not part of an array formula.");
        }
        FormulaRecordAggregate fra = (FormulaRecordAggregate) rec;
        CellRangeAddress range = fra.removeArrayFormula(cell.getRowIndex(), cell.getColumnIndex());
View Full Code Here

    int absColIx = getFirstColumn() + columnIndex;
    return new LazyAreaEval(getFirstRow(), absColIx, getLastRow(), absColIx, _evaluator);
  }

  public String toString() {
    CellReference crA = new CellReference(getFirstRow(), getFirstColumn());
    CellReference crB = new CellReference(getLastRow(), getLastColumn());
    StringBuffer sb = new StringBuffer();
    sb.append(getClass().getName()).append("[");
    sb.append(_evaluator.getSheetName());
    sb.append('!');
    sb.append(crA.formatAsString());
    sb.append(':');
    sb.append(crB.formatAsString());
    sb.append("]");
    return sb.toString();
  }
View Full Code Here

   */
  private ParseNode createAreaRefParseNode(SheetIdentifier sheetIden, SimpleRangePart part1,
      SimpleRangePart part2) throws FormulaParseException {
    Ptg ptg;
    if (part2 == null) {
      CellReference cr = part1.getCellReference();
      if (sheetIden == null) {
        ptg = new RefPtg(cr);
      } else {
        ptg = _book.get3DReferencePtg(cr, sheetIden);
      }
View Full Code Here

    public CellReference getCellReference() {
      if (_type != Type.CELL) {
        throw new IllegalStateException("Not applicable to this type");
      }
      return new CellReference(_rep);
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.ss.util.CellReference

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.