Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.poi.xssf.streaming
Class SXSSFRow

    java.lang.Object
      org.apache.poi.xssf.streaming.SXSSFRow

All Implemented Interfaces:
  org.apache.poi.ss.usermodel.Row, poi.support.Iterable

    public class SXSSFRow

extends java.lang.Object
implements org.apache.poi.ss.usermodel.Row

Streaming version of XSSFRow implementing the "BigGridDemo" strategy.

Author:
  Alex Geller, Four J's Development Tools

Nested Class Summary
`class` | `SXSSFRow.CellIterator` returns all cells including empty cells in which case "null" is returned
`class` | `SXSSFRow.FilledCellIterator` returns all filled cells (created via Row.createCell())

Nested classes/interfaces inherited from interface org.apache.poi.ss.usermodel.Row
`org.apache.poi.ss.usermodel.Row.MissingCellPolicy`

Field Summary

Fields inherited from interface org.apache.poi.ss.usermodel.Row
`CREATE_NULL_AS_BLANK, RETURN_BLANK_AS_NULL, RETURN_NULL_AND_BLANK`

Constructor Summary
`SXSSFRow(SXSSFSheet sheet, int initialSize)`

Method Summary
`java.util.Iterator` | `allCellsIterator()`
`java.util.Iterator` | `cellIterator()`
`org.apache.poi.ss.usermodel.Cell` | `createCell(int column)` Use this to create new cells within the row and return it.
`org.apache.poi.ss.usermodel.Cell` | `createCell(int column, int type)` Use this to create new cells within the row and return it.
`org.apache.poi.ss.usermodel.Cell` | `getCell(int cellnum)` Get the cell representing a given column (logical cell) 0-based.
`org.apache.poi.ss.usermodel.Cell` | `getCell(int cellnum, org.apache.poi.ss.usermodel.Row.MissingCellPolicy policy)` Returns the cell at the given (0 based) index, with the specified `Row.MissingCellPolicy`
`short` | `getFirstCellNum()` Get the number of the first cell contained in this row.
`short` | `getHeight()` Get the row's height measured in twips (1/20th of a point).
`float` | `getHeightInPoints()` Returns row height measured in point size.
`short` | `getLastCellNum()` Gets the index of the last cell contained in this row PLUS ONE.
`int` | `getPhysicalNumberOfCells()` Gets the number of defined cells (NOT number of cells in the actual row!).
`int` | `getRowNum()` Get row number this row represents
`org.apache.poi.ss.usermodel.CellStyle` | `getRowStyle()` Returns the whole-row cell style.
`org.apache.poi.ss.usermodel.Sheet` | `getSheet()` Returns the Sheet this row belongs to
`boolean` | `getZeroHeight()` Get whether or not to display this row with 0 height
`boolean` | `hasCustomHeight()`
`boolean` | `isFormatted()` Is this row formatted? Most aren't, but some rows do have whole-row styles.
`java.util.Iterator` | `iterator()`
`void` | `removeCell(org.apache.poi.ss.usermodel.Cell cell)` Remove the Cell from this row.
`void` | `setHeight(short height)` Set the row's height or set to ff (-1) for undefined/default-height.
`void` | `setHeightInPoints(float height)` Set the row's height in points.
`void` | `setRowNum(int rowNum)` Set the row number of this row.
`void` | `setRowStyle(org.apache.poi.ss.usermodel.CellStyle style)` Applies a whole-row cell styling to the row.
`void` | `setZeroHeight(boolean zHeight)` Set whether or not to display this row with 0 height

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SXSSFRow

    public SXSSFRow(SXSSFSheet sheet,
                    int initialSize)

Method Detail

### allCellsIterator

    public java.util.Iterator allCellsIterator()

### hasCustomHeight

    public boolean hasCustomHeight()

### iterator

    public java.util.Iterator iterator()

  Specified by:
    `iterator` in interface `poi.support.Iterable`

### createCell

    public org.apache.poi.ss.usermodel.Cell createCell(int column)

  Use this to create new cells within the row and return it.

  The cell that is returned is a `Cell.CELL_TYPE_BLANK`. The type can be changed either through calling `setCellValue` or `setCellType`.

  Specified by:
    `createCell` in interface `org.apache.poi.ss.usermodel.Row`
  Parameters:
    `column` - - the column number this cell represents
  Returns:
    Cell a high level representation of the created cell.
  Throws:
    `java.lang.IllegalArgumentException` - if columnIndex < 0 or greater than the maximum number of supported columns (255 for *.xls, 1048576 for *.xlsx)

### createCell

    public org.apache.poi.ss.usermodel.Cell createCell(int column,
                                                       int type)

  Use this to create new cells within the row and return it.

  The cell that is returned is a `Cell.CELL_TYPE_BLANK`. The type can be changed either through calling setCellValue or setCellType.

  Specified by:
    `createCell` in interface `org.apache.poi.ss.usermodel.Row`
  Parameters:
    `column` - - the column number this cell represents
  Returns:
    Cell a high level representation of the created cell.
  Throws:
    `java.lang.IllegalArgumentException` - if columnIndex < 0 or greate than a maximum number of supported columns (255 for *.xls, 1048576 for *.xlsx)

### removeCell

    public void removeCell(org.apache.poi.ss.usermodel.Cell cell)

  Remove the Cell from this row.

  Specified by:
    `removeCell` in interface `org.apache.poi.ss.usermodel.Row`
  Parameters:
    `cell` - the cell to remove

### setRowNum

    public void setRowNum(int rowNum)

  Set the row number of this row.

  Specified by:
    `setRowNum` in interface `org.apache.poi.ss.usermodel.Row`
  Parameters:
    `rowNum` - the row number (0-based)
  Throws:
    `java.lang.IllegalArgumentException` - if rowNum < 0

### getRowNum

    public int getRowNum()

  Get row number this row represents

  Specified by:
    `getRowNum` in interface `org.apache.poi.ss.usermodel.Row`
  Returns:
    the row number (0 based)

### getCell

    public org.apache.poi.ss.usermodel.Cell getCell(int cellnum)

  Get the cell representing a given column (logical cell) 0-based. If you ask for a cell that is not defined....you get a null.

  Specified by:
    `getCell` in interface `org.apache.poi.ss.usermodel.Row`
  Parameters:
    `cellnum` - 0 based column number
  Returns:
    Cell representing that column or null if undefined.
  See Also:
    `getCell(int, org.apache.poi.ss.usermodel.Row.MissingCellPolicy)`

### getCell

    public org.apache.poi.ss.usermodel.Cell getCell(int cellnum,
                                                    org.apache.poi.ss.usermodel.Row.MissingCellPolicy policy)

  Returns the cell at the given (0 based) index, with the specified `Row.MissingCellPolicy`

  Specified by:
    `getCell` in interface `org.apache.poi.ss.usermodel.Row`
  Returns:
    the cell at the given (0 based) index
  Throws:
    `java.lang.IllegalArgumentException` - if cellnum < 0 or the specified MissingCellPolicy is invalid
  See Also:
    `Row.RETURN_NULL_AND_BLANK`, `Row.RETURN_BLANK_AS_NULL`, `Row.CREATE_NULL_AS_BLANK`

### getFirstCellNum

    public short getFirstCellNum()

  Get the number of the first cell contained in this row.

  Specified by:
    `getFirstCellNum` in interface `org.apache.poi.ss.usermodel.Row`
  Returns:
    short representing the first logical cell in the row, or -1 if the row does not contain any cells.

### getLastCellNum

    public short getLastCellNum()

  Gets the index of the last cell contained in this row PLUS ONE. The result also happens to be the 1-based column number of the last cell. This value can be used as a standard upper bound when iterating over cells:

       short minColIx = row.getFirstCellNum();
       short maxColIx = row.getLastCellNum();
       for(short colIx=minColIx; colIx<maxColIx; colIx++) {
         Cell cell = row.getCell(colIx);
         if(cell == null) {
           continue;
         }
         //... do something with cell
       }

  Specified by:
    `getLastCellNum` in interface `org.apache.poi.ss.usermodel.Row`
  Returns:
    short representing the last logical cell in the row PLUS ONE, or -1 if the row does not contain any cells.

### getPhysicalNumberOfCells

    public int getPhysicalNumberOfCells()

  Gets the number of defined cells (NOT number of cells in the actual row!). That is to say if only columns 0,4,5 have values then there would be 3.

  Specified by:
    `getPhysicalNumberOfCells` in interface `org.apache.poi.ss.usermodel.Row`
  Returns:
    int representing the number of defined cells in the row.

### setHeight

    public void setHeight(short height)

  Set the row's height or set to ff (-1) for undefined/default-height. Set the height in "twips" or 1/20th of a point.

  Specified by:
    `setHeight` in interface `org.apache.poi.ss.usermodel.Row`
  Parameters:
    `height` - rowheight or 0xff for undefined (use sheet default)

### setZeroHeight

    public void setZeroHeight(boolean zHeight)

  Set whether or not to display this row with 0 height

  Specified by:
    `setZeroHeight` in interface `org.apache.poi.ss.usermodel.Row`
  Parameters:
    `zHeight` - height is zero or not.

### getZeroHeight

    public boolean getZeroHeight()

  Get whether or not to display this row with 0 height

  Specified by:
    `getZeroHeight` in interface `org.apache.poi.ss.usermodel.Row`
  Returns:
    - zHeight height is zero or not.

### setHeightInPoints

    public void setHeightInPoints(float height)

  Set the row's height in points.

  Specified by:
    `setHeightInPoints` in interface `org.apache.poi.ss.usermodel.Row`
  Parameters:
    `height` - the height in points. `-1` resets to the default height

### getHeight

    public short getHeight()

  Get the row's height measured in twips (1/20th of a point). If the height is not set, the default worksheet value is returned, See `Sheet.getDefaultRowHeightInPoints()`

  Specified by:
    `getHeight` in interface `org.apache.poi.ss.usermodel.Row`
  Returns:
    row height measured in twips (1/20th of a point)

### getHeightInPoints

    public float getHeightInPoints()

  Returns row height measured in point size. If the height is not set, the default worksheet value is returned, See `Sheet.getDefaultRowHeightInPoints()`

  Specified by:
    `getHeightInPoints` in interface `org.apache.poi.ss.usermodel.Row`
  Returns:
    row height measured in point size
  See Also:
    `Sheet.getDefaultRowHeightInPoints()`

### isFormatted

    public boolean isFormatted()

  Is this row formatted? Most aren't, but some rows do have whole-row styles. For those that do, you can get the formatting from `getRowStyle()`

  Specified by:
    `isFormatted` in interface `org.apache.poi.ss.usermodel.Row`

### getRowStyle

    public org.apache.poi.ss.usermodel.CellStyle getRowStyle()

  Returns the whole-row cell style. Most rows won't have one of these, so will return null. Call `isFormatted()` to check first.

  Specified by:
    `getRowStyle` in interface `org.apache.poi.ss.usermodel.Row`

### setRowStyle

    public void setRowStyle(org.apache.poi.ss.usermodel.CellStyle style)

  Applies a whole-row cell styling to the row.

  Specified by:
    `setRowStyle` in interface `org.apache.poi.ss.usermodel.Row`

### cellIterator

    public java.util.Iterator cellIterator()

  Specified by:
    `cellIterator` in interface `org.apache.poi.ss.usermodel.Row`
  Returns:
    Cell iterator of the physically defined cells. Note element 4 may actually be row cell depending on how many are defined!

### getSheet

    public org.apache.poi.ss.usermodel.Sheet getSheet()

  Returns the Sheet this row belongs to

  Specified by:
    `getSheet` in interface `org.apache.poi.ss.usermodel.Row`
  Returns:
    the Sheet that owns this row

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD