Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate


com.aspose.cells
Class Row

java.lang.Object
  extended by com.aspose.cells.Row

public class Row
extends java.lang.Object

Represents a row of a spreadsheet.


Method Summary
 void applyStyle(Style style, StyleFlag flag)
          Applies formattings for a whole row.
 Cell checkCell(int columnIndex)
          Given a column index, checks if the cell has been defined.
 int compareTo(int indexTo)
          Compares this Row with another one that has given row index for order.
 int compareTo(Row rowTo)
          Compares this Row with another one for order.
 Cell getCell(int columnIndex)
          Gets the cell at the specified column index.
 java.util.Iterator<Cell> getCellIterator()
          Returns an iterator which can iterate all defined cells in this row.
 short getFirstCellIndex()
          Gets the index of the first defined cell.
 float getHeight()
          Gets the height of the row in points.
 int getKey()
          Gets the comparable key of this Row.
 short getLastCellIndex()
          Gets the index of the last defined cell.
 Style getRefStyle()
          Gets the style setting for the column.
 int getRowIndex()
          Gets the row index.
 Style getStyle()
          Gets the style of the row.
 boolean isAutoFitHeight()
          Indicates whether row's height is auto-fit.
 boolean isHidden()
          Checks if the row is hidden.
 boolean isUsingDefaultHeight()
          Indicates whether row has default row height.
 void removeCell(int columnIndex)
          Removes the cell at the specified column index.
 void setAutoFitHeight(boolean isAutoFitHeight)
          Sets whether row's height is auto-fit.
 void setDefaultHeight()
          Invalidate the row height setting.
 void setHeight(float height)
          Sets the row height, in points.
 void setHidden(boolean isHidden)
          Sets whether the row to be hidden or not.
 void setKey(int key)
          Sets the comparable key of this Row.
 void setStyle(int startColumn, int endColumn, Style style)
          Sets style for a continuous range of cells of the row.
 void setStyle(Style style)
          Sets the style of the row.
 void setUseDefaultHeight(boolean isUsingDefaultHeight)
          Sets whether row has default row height .
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRowIndex

public int getRowIndex()
Gets the row index.

Throws:
CellsException - if the row has been removed from the worksheet.

getCell

public Cell getCell(int columnIndex)
Gets the cell at the specified column index.

Parameters:
columnIndex - the column index.
Returns:
the cell
Throws:
CellsException - if the row has been removed from the worksheet.

checkCell

public Cell checkCell(int columnIndex)
Given a column index, checks if the cell has been defined.

Parameters:
columnIndex - the column index.
Returns:
the cell object if it has been defined. Otherwise, returns null.
Throws:
CellsException - if the row has been removed from the worksheet.

removeCell

public void removeCell(int columnIndex)
Removes the cell at the specified column index.

Parameters:
columnIndex - the column index
Throws:
CellsException - if the row has been removed from the worksheet.

getRefStyle

public Style getRefStyle()
Gets the style setting for the column.

Returns:
style of the column.
Throws:
CellsException - if the worksheet has been removed from the workbook.

getStyle

public Style getStyle()
Gets the style of the row.

Throws:
CellsException - if the row has been removed from the worksheet.

setStyle

public void setStyle(Style style)
Sets the style of the row.

Parameters:
style - style of the row.

applyStyle

public void applyStyle(Style style,
                       StyleFlag flag)
Applies formattings for a whole row. Only modifies the styles of the row and cells in the row.

Parameters:
style - The style object which will be applied.
flag - Flags which indicates applied formatting properties.

getHeight

public float getHeight()
Gets the height of the row in points.

Returns:
row height, in points.

setHeight

public void setHeight(float height)
Sets the row height, in points.

Parameters:
height - height of the row, in points(0-409).
Throws:
java.lang.IllegalArgumentException - if the row height is invalid.

setDefaultHeight

public void setDefaultHeight()
Invalidate the row height setting. Obliges this row to use the default row height of the worksheet that the row belongs to.


isHidden

public boolean isHidden()
Checks if the row is hidden.

Returns:
true if the row is hidden.

setHidden

public void setHidden(boolean isHidden)
Sets whether the row to be hidden or not.

Parameters:
isHidden - true for hidden.

getFirstCellIndex

public short getFirstCellIndex()
Gets the index of the first defined cell.

Returns:
index of the first defined cell. Returns -1 if no cell is defined.

getLastCellIndex

public short getLastCellIndex()
Gets the index of the last defined cell.

Returns:
index of the last defined cell. Returns -1 if no cell is defined.

getCellIterator

public java.util.Iterator<Cell> getCellIterator()
Returns an iterator which can iterate all defined cells in this row. It is guaranteed the next() method accesses all cells order by cell index.

Returns:
an object that implements the Iterator interface.
Throws:
CellsException - if the row has been removed from the worksheet.

setStyle

public void setStyle(int startColumn,
                     int endColumn,
                     Style style)
Sets style for a continuous range of cells of the row.

Parameters:
startColumn - start column index.
endColumn - end column index.
style - the style to set.
Throws:
java.lang.IllegalArgumentException - if any of the column indexes is out of range.
CellsException - if the row has been removed from the worksheet.

isUsingDefaultHeight

public boolean isUsingDefaultHeight()
Indicates whether row has default row height.

Returns:
whether row has default row height.

setUseDefaultHeight

public void setUseDefaultHeight(boolean isUsingDefaultHeight)
Sets whether row has default row height .

Parameters:
isUsingDefaultHeight - whether row has default row height.

isAutoFitHeight

public boolean isAutoFitHeight()
Indicates whether row's height is auto-fit.

Returns:
true if row's height is auto-fit.

setAutoFitHeight

public void setAutoFitHeight(boolean isAutoFitHeight)
Sets whether row's height is auto-fit.

Parameters:
isAutoFitHeight - whether row's height is auto-fit.

compareTo

public int compareTo(int indexTo)
Compares this Row with another one that has given row index for order.

Parameters:
indexTo - the row index to be compared with the row index of this Row.
Returns:
a negative integer, zero, or a positive integer as the row index of this Row is less than, equal to, or greater than the specified row index.

compareTo

public int compareTo(Row rowTo)
Compares this Row with another one for order.

Parameters:
rowTo - the Row to be compared with this one.
Returns:
a negative integer, zero, or a positive integer as the row index of this Row is less than, equal to, or greater than the row index of the specified Row object.

getKey

public int getKey()
Gets the comparable key of this Row. Same with getRowIndex().

Returns:
the comparable key of this Row, that is the row index of this Row.

setKey

public void setKey(int key)
Sets the comparable key of this Row. Only for inner usage. Does not make any change for this Row object.

Parameters:
key - key value.