Examples of CellValueRecordInterface


Examples of org.apache.poi.hssf.record.CellValueRecordInterface

    constructValueRecord(records);
    CellValueRecordInterface[] cvrs = valueRecord.getValueRecords();
    //Ensure that the SharedFormulaRecord has been converted
    assertEquals(1, cvrs.length);

    CellValueRecordInterface record = cvrs[0];
    assertNotNull( "Row contains a value", record );
    assertTrue( "First record is a FormulaRecordsAggregate", ( record instanceof FormulaRecordAggregate ) );
  }
View Full Code Here

Examples of org.apache.poi.hssf.record.CellValueRecordInterface

   * starting from startIx.
   */
  private static int countBlanks(CellValueRecordInterface[] rowCellValues, int startIx) {
    int i = startIx;
    while(i < rowCellValues.length) {
      CellValueRecordInterface cvr = rowCellValues[i];
      if (!(cvr instanceof BlankRecord)) {
        break;
      }
      i++;
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.CellValueRecordInterface

      CellValueRecordInterface[] rowCells = records[i];
      if (rowCells == null) {
        continue;
      }
      for (int j = 0; j < rowCells.length; j++) {
        CellValueRecordInterface cell = rowCells[j];
        if (cell instanceof FormulaRecordAggregate) {
                    FormulaRecordAggregate fra = (FormulaRecordAggregate)cell;
                    Ptg[] ptgs = fra.getFormulaTokens(); // needs clone() inside this getter?
                    Ptg[] ptgs2 = ((FormulaRecordAggregate)cell).getFormulaRecord().getParsedExpression(); // needs clone() inside this getter?
View Full Code Here

Examples of org.apache.poi.hssf.record.CellValueRecordInterface

      CellValueRecordInterface[] rowCells = records[rowIx];
      if (rowCells == null) {
        continue;
      }
      for (int colIx = 0; colIx < rowCells.length; colIx++) {
        CellValueRecordInterface cell = rowCells[colIx];
        if (cell != null) {
          temp.add(cell);
        }
      }
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.CellValueRecordInterface

      if (!hasNext())
        throw new IndexOutOfBoundsException("iterator has no next");

      curRowIndex = nextRowIndex;
      curColIndex = nextColIndex;
      final CellValueRecordInterface ret = records[curRowIndex][curColIndex];
      getNextPos();
      return ret;
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.CellValueRecordInterface

    InternalSheet sheet = InternalSheet.createSheet();

    RowRecord rr = new RowRecord(5);
    sheet.addRow(rr);

    CellValueRecordInterface cvr = new BlankRecord();
    cvr.setColumn((short)0);
    cvr.setRow(5);
    sheet.addValueRecord(5, cvr);


    int dbCellRecordPos = getDbCellRecordPos(sheet);
    if (dbCellRecordPos == 252) {
View Full Code Here

Examples of org.apache.poi.hssf.record.CellValueRecordInterface

        assertEquals(0, dimensions.getFirstCol());
        assertEquals(0, dimensions.getFirstRow());
        assertEquals(1, dimensions.getLastCol());
        assertEquals(1, dimensions.getLastRow());

        CellValueRecordInterface cvr;

        cvr = new BlankRecord();
        cvr.setColumn((short)0);
        cvr.setRow(0);
        sheet.addValueRecord(0, cvr);

        assertEquals(0, dimensions.getFirstCol());
        assertEquals(0, dimensions.getFirstRow());
        assertEquals(1, dimensions.getLastCol());
        assertEquals(1, dimensions.getLastRow());

        cvr = new BlankRecord();
        cvr.setColumn((short)1);
        cvr.setRow(0);
        sheet.addValueRecord(0, cvr);

        assertEquals(0, dimensions.getFirstCol());
        assertEquals(0, dimensions.getFirstRow());
        assertEquals(2, dimensions.getLastCol());   //YK:  failed until Bugzilla 53414 was fixed
View Full Code Here

Examples of org.apache.poi.hssf.record.CellValueRecordInterface

        confirmCachedValue("90210", nc3);

        @SuppressWarnings("deprecation")
        CellValueRecordInterface[] cvrs = ns.getSheet().getValueRecords();
        for (int i = 0; i < cvrs.length; i++) {
            CellValueRecordInterface cvr = cvrs[i];
            if(cvr instanceof FormulaRecordAggregate) {
                FormulaRecordAggregate fr = (FormulaRecordAggregate)cvr;

                if(i == 0) {
                    assertEquals(70164.0, fr.getFormulaRecord().getValue(), 0.0001);
View Full Code Here

Examples of org.apache.poi.hssf.record.CellValueRecordInterface

        }

        cells[column]=null;

        if(alsoRemoveRecords) {
            CellValueRecordInterface cval = cell.getCellValueRecord();
            sheet.getSheet().removeValueRecord(getRowNum(), cval);
        }
        if (cell.getColumnIndex()+1 == row.getLastCol()) {
            row.setLastCol(calculateNewLastCellPlusOne(row.getLastCol()));
        }
View Full Code Here

Examples of org.apache.poi.hssf.record.CellValueRecordInterface

                new Long(timestart));
        HSSFRow lastrow = null;

        // Add every cell to its row
        for (int i = 0; i < cvals.length; i++) {
            CellValueRecordInterface cval = cvals[i];

            long cellstart = System.currentTimeMillis();
            HSSFRow hrow = lastrow;

            if (hrow == null || hrow.getRowNum() != cval.getRow()) {
                hrow = getRow( cval.getRow() );
                lastrow = hrow;
                if (hrow == null) {
                    // Some tools (like Perl module Spreadsheet::WriteExcel - bug 41187) skip the RowRecords
                    // Excel, OpenOffice.org and GoogleDocs are all OK with this, so POI should be too.
                    if (rowRecordsAlreadyPresent) {
                        // if at least one row record is present, all should be present.
                        throw new RuntimeException("Unexpected missing row when some rows already present");
                    }
                    // create the row record on the fly now.
                    RowRecord rowRec = new RowRecord(cval.getRow());
                    sheet.addRow(rowRec);
                    hrow = createRowFromRecord(rowRec);
                }
            }
            if (log.check( POILogger.DEBUG ))
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.