Save This Page
Home » poi-src-3.2-FINAL-20081019 » org.apache » poi » hssf » usermodel » [javadoc | source]
org.apache.poi.hssf.usermodel
public final class: HSSFRow [javadoc | source]
java.lang.Object
   org.apache.poi.hssf.usermodel.HSSFRow

All Implemented Interfaces:
    Comparable

High level representation of a row of a spreadsheet. Only rows that have cells should be added to a Sheet.
Nested Class Summary:
public static class  HSSFRow.MissingCellPolicy  Used to specify the different possible policies if for the case of null and blank cells 
Field Summary
public static final  int INITIAL_CAPACITY     
public static final  HSSFRow.MissingCellPolicy RETURN_NULL_AND_BLANK    Missing cells are returned as null, Blank cells are returned as normal 
public static final  HSSFRow.MissingCellPolicy RETURN_BLANK_AS_NULL    Missing cells are returned as null, as are blank cells 
public static final  HSSFRow.MissingCellPolicy CREATE_NULL_AS_BLANK    A new, blank cell is created for missing cells. Blank cells are returned as normal 
Constructor:
 HSSFRow() 
 HSSFRow(HSSFWorkbook book,
    Sheet sheet,
    int rowNum) 
    Creates new HSSFRow from scratch. Only HSSFSheet should do this.
    Parameters:
    book - low-level Workbook object containing the sheet that contains this row
    sheet - low-level Sheet object that contains this Row
    rowNum - the row number of this row (0 based)
    Also see:
    org.apache.poi.hssf.usermodel.HSSFSheet#createRow(int)
 HSSFRow(HSSFWorkbook book,
    Sheet sheet,
    RowRecord record) 
    Creates an HSSFRow from a low level RowRecord object. Only HSSFSheet should do this. HSSFSheet uses this when an existing file is read in.
    Parameters:
    book - low-level Workbook object containing the sheet that contains this row
    sheet - low-level Sheet object that contains this Row
    record - the low level api object this row should represent
    Also see:
    org.apache.poi.hssf.usermodel.HSSFSheet#createRow(int)
Method from org.apache.poi.hssf.usermodel.HSSFRow Summary:
cellIterator,   compareTo,   createCell,   createCell,   createCellFromRecord,   equals,   getCell,   getCell,   getCell,   getFirstCellNum,   getHeight,   getHeightInPoints,   getLastCellNum,   getOutlineLevel,   getPhysicalNumberOfCells,   getRowNum,   getRowRecord,   getZeroHeight,   iterator,   moveCell,   removeCell,   setHeight,   setHeightInPoints,   setRowNum,   setZeroHeight
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.poi.hssf.usermodel.HSSFRow Detail:
 public Iterator cellIterator() 
 public int compareTo(Object obj) 
 public HSSFCell createCell(short column) 
    Use this to create new cells within the row and return it.

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

 public HSSFCell createCell(short column,
    int type) 
    Use this to create new cells within the row and return it.

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

 protected HSSFCell createCellFromRecord(CellValueRecordInterface cell) 
    create a high level HSSFCell object from an existing low level record. Should only be called from HSSFSheet or HSSFRow itself.
 public boolean equals(Object obj) 
 public HSSFCell getCell(short cellnum) 
    Get the hssfcell representing a given column (logical cell) 0-based. If you ask for a cell that is not defined then you get a null, unless you have set a different MissingCellPolicy on the base workbook. Short method signature provided to retain binary compatibility.
 public HSSFCell getCell(int cellnum) 
    Get the hssfcell representing a given column (logical cell) 0-based. If you ask for a cell that is not defined then you get a null, unless you have set a different MissingCellPolicy on the base workbook.
 public HSSFCell getCell(int cellnum,
    HSSFRow.MissingCellPolicy policy) 
    Get the hssfcell representing a given column (logical cell) 0-based. If you ask for a cell that is not defined, then your supplied policy says what to do
 public short getFirstCellNum() 
    get the number of the first cell contained in this row.
 public short getHeight() 
    get the row's height or ff (-1) for undefined/default-height in twips (1/20th of a point)
 public float getHeightInPoints() 
    get the row's height or ff (-1) for undefined/default-height in points (20*getHeight())
 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++) {
    HSSFCell cell = row.getCell(colIx);
    if(cell == null) {
    continue;
    }
    //... do something with cell
    }
    
 protected int getOutlineLevel() 
    Returns the rows outline level. Increased as you put it into more groups (outlines), reduced as you take it out of them. TODO - Should this really be public?
 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.
 public int getRowNum() 
    get row number this row represents
 protected RowRecord getRowRecord() 
    get the lowlevel RowRecord represented by this object - should only be called by other parts of the high level API
 public boolean getZeroHeight() 
    get whether or not to display this row with 0 height
 public Iterator iterator() 
 public  void moveCell(HSSFCell cell,
    short newColumn) 
    Moves the supplied cell to a new column, which must not already have a cell there!
 public  void removeCell(HSSFCell cell) 
    remove the HSSFCell from this row.
 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.
 public  void setHeightInPoints(float height) 
    set the row's height in points.
 public  void setRowNum(int rowNum) 
    set the row number of this row.
 public  void setZeroHeight(boolean zHeight) 
    set whether or not to display this row with 0 height