com.f1j.data
Interface DataRangeFormatIterator

All Known Subinterfaces:
DataRange

public interface DataRangeFormatIterator
extends DataRangeIterator

Use the DataRangeFormatIterator API for pumping data into a data range and formatting it.

You must call the methods in the following order.

 

getLock() startRange() startRow() startCell() setCell() endCell() endRow() endRange() releaseLock()


Method Summary
 ConditionalFormat[] getCellConditionalFormats()
          Returns an array of the three conditional formats that can be used with the current cell.
 com.f1j.data.CellFormat getCellFormat()
          Returns the cell format associated with the current cell.
 ConditionalFormat[] getRangeConditionalFormats()
          Returns an array of the three conditional formats that can be used with this range.
 com.f1j.data.CellFormat getRangeFormat()
          Returns the current cell format associated with this range.
 ConditionalFormat[] getRowConditionalFormats()
          Returns an array of the three conditional formats that can be used with the current row.
 com.f1j.data.CellFormat getRowFormat()
          Returns the cell format associated with the current row.
 void insertRowPageBreak()
          Inserts a row page break at the current row.
 void setCellConditionalFormatUsed(int numberUsed)
          Sets the number of conditional formats used for the current cell.
 void setColumnOutlineCollapsed(boolean collapsed)
          Sets whether an outline group is collapsed or expanded.
 void setColumnOutlineLevel(int level)
          Sets the outline level of the current column.
 void setColumnSummaryBeforeDetail(boolean summaryBeforeDetail)
          Sets how the summary detail is displayed.
 void setColumnWidth(int width)
          Sets the column width for the column associated with the current cell.
 void setDefaultColumnWidth(int width)
          Sets the default column width used in this range.
 void setDefaultRowHeight(int height)
          Sets the default row height used in this range.
 void setFormula(java.lang.String formula)
          Sets the formula for the current cell.
 void setRangeConditionalFormatUsed(int numberUsed)
          Sets the number of conditional formats used for this range.
 void setRowConditionalFormatUsed(int numberUsed)
          Sets the number of conditional formats used for the current row.
 void setRowHeight(int height)
          Sets the row height of the current row.
 void setRowHidden(boolean hidden)
          Sets the current row in the iteration to hidden.
 void setRowOutlineCollapsed(boolean collapsed)
          Sets whether an outline group is collapsed or expanded.
 void setRowOutlineLevel(int level)
          Sets the outline level of the current row.
 void setRowSummaryBeforeDetail(boolean summaryBeforeDetail)
          Sets a flag indicating whether row outline summaries come before row detail information.
 void startCell(int horizontalSpan, int verticalSpan)
          Use this to set the vertical and horizontal span of the cell.
 void updateCellName(java.lang.String name, boolean rowAbsolute)
          Updates or creates the given defined name to include the current cell location and sets whether the row reference is absolute or relative.
 void updateRowName(java.lang.String name)
          Updates or creates the given defined name to include the current row and sets the row reference to relative column, absolute row (C$1:C$14).
 
Methods inherited from interface com.f1j.data.DataRangeIterator
endCell, endColumnName, endFieldInfo, endMetaData, endRange, endRow, setCell, setCell, setCell, setCellAsText, setCellHyperlink, setColumnName, setFieldLabel, setFieldName, setTableName, startCell, startColumnName, startFieldInfo, startMetaData, startRange, startRow
 

Method Detail

getCellConditionalFormats

public ConditionalFormat[] getCellConditionalFormats()
Returns an array of the three conditional formats that can be used with the current cell. Call this method after calling the startCell() method, change one or more of the formats, then call the setCellConditionalFormatUsed() method with the number of conditional formats used with this cell. This must be done before the call to the setCell() method.
Returns:
a ConditionalFormat object.
See Also:
ConditionalFormat, getCellFormat(), getRangeConditionalFormats(), getRowConditionalFormats(), setCellConditionalFormatUsed(int), setRangeConditionalFormatUsed(int), setRowConditionalFormatUsed(int)

getCellFormat

public com.f1j.data.CellFormat getCellFormat()
Returns the cell format associated with the current cell. Call this method after calling the startCell() method, then change the cell format before the call to the setCell() method.
Returns:
a CellFormat object.
See Also:
CellFormat, BookModel.getCellFormat(com.f1j.ss.CellFormat), getRangeFormat(), getRowFormat()

getRangeConditionalFormats

public ConditionalFormat[] getRangeConditionalFormats()
Returns an array of the three conditional formats that can be used with this range. Call this method after calling the startRange() method, change one or more of the formats, then call the setRangeConditionalFormatUsed() method with the number of conditional formats used with this range. This must be done before the first call to the setCell() method.
Returns:
a ConditionalFormat object.
See Also:
ConditionalFormat, getCellConditionalFormats(), getCellFormat(), getRowConditionalFormats(), setCellConditionalFormatUsed(int), setRangeConditionalFormatUsed(int), setRowConditionalFormatUsed(int)

getRangeFormat

public com.f1j.data.CellFormat getRangeFormat()
Returns the current cell format associated with this range. This CellFormat will be used for all cells in the range unless the row or cell specifically has a format. Call this method after calling the startRange() method, then change the cell format before the call to the setCell() method.
Returns:
a CellFormat object.
See Also:
CellFormat, getCellFormat(), getRowFormat()

getRowConditionalFormats

public ConditionalFormat[] getRowConditionalFormats()
Returns an array of the three conditional formats that can be used with the current row. Call this method after calling the startRow() method, change one or more of the formats, then call the setRowConditionalFormatUsed() method with the number of conditional formats used with this row. This must be done before the first call to the setCell() method.
Returns:
a ConditionalFormat object.
See Also:
ConditionalFormat, getCellConditionalFormats(), getCellFormat(), getRangeConditionalFormats(), setCellConditionalFormatUsed(int), setRangeConditionalFormatUsed(int), setRowConditionalFormatUsed(int)

getRowFormat

public com.f1j.data.CellFormat getRowFormat()
Returns the cell format associated with the current row. This CellFormat will be used for all cells in the current row unless the cell specifically has a format. Call this method after the startRow() method and before the first call to the setCell() method in the row.
Returns:
a CellFormat object.
See Also:
CellFormat, getCellFormat(), getRangeFormat()

insertRowPageBreak

public void insertRowPageBreak()
Inserts a row page break at the current row.

setCellConditionalFormatUsed

public void setCellConditionalFormatUsed(int numberUsed)
Sets the number of conditional formats used for the current cell.
Parameters:
numberUsed - an integer indicating the number of conditional formats.
See Also:
ConditionalFormat, getCellConditionalFormats(), getCellFormat(), getRangeConditionalFormats(), getRowConditionalFormats(), setRangeConditionalFormatUsed(int), setRowConditionalFormatUsed(int)

setColumnOutlineCollapsed

public void setColumnOutlineCollapsed(boolean collapsed)
                               throws F1Exception
Sets whether an outline group is collapsed or expanded. The column must currently have an outline type of eOutlineCollapsed or eOutlineExpanded.
Parameters:
collapsed - boolean. true = collapse the outline group. false = expand the outline group.

setColumnOutlineLevel

public void setColumnOutlineLevel(int level)
                           throws F1Exception
Sets the outline level of the current column.
Parameters:
level - an integer between 1 and 7 indicating the outline level.
Throws:
F1Exception - if an error occurs
See Also:
setColumnOutlineLevel(int), setRowOutlineLevel(int), setColumnSummaryBeforeDetail(boolean), setRowSummaryBeforeDetail(boolean), BookModel.setColOutlineLevel(int, int, int, boolean)

setColumnWidth

public void setColumnWidth(int width)
                    throws F1Exception
Sets the column width for the column associated with the current cell.
Parameters:
width - an integer indicating the current column width.
Throws:
F1Exception - if an error occurs
See Also:
BookModel.setColWidth(int, int, int, boolean), setColumnWidth(int), setDefaultColumnWidth(int), setRowHeight(int), setDefaultRowHeight(int)

setColumnSummaryBeforeDetail

public void setColumnSummaryBeforeDetail(boolean summaryBeforeDetail)
Sets how the summary detail is displayed. Note that this effects the whole sheet, not just the range.
Parameters:
summaryBeforeDetail - boolean. Indicates how summary detail is displayed. true = before detail. false = after detail.
See Also:
setColumnOutlineLevel(int), setRowOutlineLevel(int), setRowSummaryBeforeDetail(boolean), BookModel.setColSummaryBeforeDetail(boolean)

setDefaultColumnWidth

public void setDefaultColumnWidth(int width)
Sets the default column width used in this range.
Parameters:
width - an integer indicating the column width.
See Also:
BookModel.setDefaultColWidth(int), setColumnWidth(int), setRowHeight(int), setDefaultRowHeight(int)

setDefaultRowHeight

public void setDefaultRowHeight(int height)
Sets the default row height used in this range.
Parameters:
height - an integer indicating the row height.
See Also:
BookModel.setDefaultRowHeight(int), setColumnWidth(int), setDefaultColumnWidth(int), setRowHeight(int)

setFormula

public void setFormula(java.lang.String formula)
                throws F1Exception
Sets the formula for the current cell.
Parameters:
formula - a valid formula string. The string should not have a leading equal sign (=).
Throws:
F1Exception - if an error occurs
See Also:
BookModel.setFormula(int, int, java.lang.String)

setRangeConditionalFormatUsed

public void setRangeConditionalFormatUsed(int numberUsed)
Sets the number of conditional formats used for this range.
Parameters:
numberUsed - an integer indicating the number of conditional formats.
See Also:
ConditionalFormat, getCellConditionalFormats(), getCellFormat(), getRangeConditionalFormats(), getRowConditionalFormats(), setCellConditionalFormatUsed(int)

setRowConditionalFormatUsed

public void setRowConditionalFormatUsed(int numberUsed)
Sets the number of conditional formats used for the current row.
Parameters:
numberUsed - an integer indicating the number of conditional formats.
See Also:
ConditionalFormat, getCellConditionalFormats(), getCellFormat(), getRangeConditionalFormats(), getRowConditionalFormats(), setCellConditionalFormatUsed(int), setRangeConditionalFormatUsed(int)

setRowHeight

public void setRowHeight(int height)
                  throws F1Exception
Sets the row height of the current row.
Parameters:
height - an integer indicating the row height.
Throws:
F1Exception - if an error occurs
See Also:
BookModel.setRowHeight(int, int, int, boolean, boolean), setColumnWidth(int), setDefaultColumnWidth(int), setDefaultRowHeight(int)

setRowHidden

public void setRowHidden(boolean hidden)
                  throws F1Exception
Sets the current row in the iteration to hidden.
Parameters:
hidden - boolean. true = hide. false = display.
Throws:
F1Exception - if an error occurs
See Also:
BookModel.setRowHidden(int, int, boolean)

setRowOutlineCollapsed

public void setRowOutlineCollapsed(boolean collapsed)
                            throws F1Exception
Sets whether an outline group is collapsed or expanded. The row must currently have an outline type of eOutlineCollapsed or eOutlineExpanded.
Parameters:
collapsed - boolean. true = collapse the outline group. false = expand the outline group.

setRowOutlineLevel

public void setRowOutlineLevel(int level)
                        throws F1Exception
Sets the outline level of the current row.
Parameters:
level - an integer between 1 and 7 indicating the outline level.
Throws:
F1Exception - if an error occurs
See Also:
setColumnOutlineLevel(int), setColumnSummaryBeforeDetail(boolean), setRowSummaryBeforeDetail(boolean), BookModel.setRowOutlineLevel(int, int, int, boolean)

setRowSummaryBeforeDetail

public void setRowSummaryBeforeDetail(boolean summaryBeforeDetail)
Sets a flag indicating whether row outline summaries come before row detail information. Note that this method effects the entire worksheet, not just the range.
Parameters:
summaryBeforeDetail - boolean. Indicates how summary detail is displayed. true = summaries before detail. false = summaries after detail.
See Also:
setColumnOutlineLevel(int), setRowOutlineLevel(int), setColumnSummaryBeforeDetail(boolean), BookModel.setRowSummaryBeforeDetail(boolean)

startCell

public void startCell(int horizontalSpan,
                      int verticalSpan)
               throws F1Exception
Use this to set the vertical and horizontal span of the cell.
Parameters:
horizontalSpan - int. number of columns this cell spans.
verticalSpan - int. number of rows this cell spans. Note: Vertical span is ignored at this time.

updateCellName

public void updateCellName(java.lang.String name,
                           boolean rowAbsolute)
Updates or creates the given defined name to include the current cell location and sets whether the row reference is absolute or relative.
Parameters:
name - the defined name to create or update.
rowAbsolute - boolean. true = absolute column, absolute row ($C$1:$C$14). false = absolute column, relative row ($C1:$C14).
See Also:
updateRowName(java.lang.String)

updateRowName

public void updateRowName(java.lang.String name)
Updates or creates the given defined name to include the current row and sets the row reference to relative column, absolute row (C$1:C$14).
Parameters:
name - the defined name to create or update.
See Also:
updateCellName(java.lang.String, boolean)