com.f1j.ss
Interface Sheet

All Known Implementing Classes:
SheetImpl

public interface Sheet
extends Constants, com.f1j.util.ParseConstants

this interface describes the low level worksheet API.

Note: Methods in this class are not thread safe. You must assure that only one thread will call methods in this class, or you must acquire a lock on the workbook containing this sheet before calling any methods.

See Also:
Model.getLock()

Fields inherited from class com.f1j.ss.Constants
eClearAll, eClearContents, eClearDlg, eClearFormats, eClearValues, eColWidthUnitsNormal, eColWidthUnitsTwips, eCopyAll, eCopyFormats, eCopyFormulas, eCopyValues, eEncryptionAuto, eEncryptionExcel97, eEncryptionWeak, eFileActuate9, eFileCurrentFormat, eFileESpreadsheet11, eFileExcel5, eFileExcel97, eFileExcel97And5, eFileFormulaOne3, eFileFormulaOne6, eFileFormulaOne7, eFileTabbedText, eFileTabbedTextValuesOnly, eFileUnicodeText, eFileUnicodeTextValuesOnly, eFixupAppend, eFixupIgnoreAdjacentRanges, eFixupPrepend, eOutlineCollapsed, eOutlineExpanded, eOutlineTerminal, eParamCurrency, eParamDate, eParamDouble, eParametersFileActuate5, eParametersFileActuate6, eParametersFileActuate7, eParametersFileActuate8, eParamFormula, eParamInteger, eParamString, eQueryParamCurrency, eQueryParamDate, eQueryParamDouble, eQueryParamFormula, eQueryParamInteger, eQueryParamString, eSheetHidden, eSheetShown, eSheetTypeChart, eSheetTypeSheet, eSheetVeryHidden, eShiftColumns, eShiftHorizontal, eShiftRows, eShiftVertical, eShowAutomatic, eShowOff, eShowOn, eTabsBottom, eTabsOff, eTabsTop, eTypeEmpty, eTypeError, eTypeLogical, eTypeNumber, eTypeText, kAllowDefault, kAllowDeleteColumns, kAllowDeleteRows, kAllowEditObjects, kAllowFormatCells, kAllowFormatColumns, kAllowFormatRows, kAllowInsertColumns, kAllowInsertHyperlinks, kAllowInsertRows, kAllowNone, kAllowSelectLocked, kAllowSelectUnlocked, kAllowSort, kAllowUseAutoFilter, kAllowUsePivotRanges, kCodePageDefaultANSI, kCodePageUnicodeBE, kCodePageUnicodeLE, kCodePageUTF8, kContentsChanged, kFontChanged, kFormatChanged, kMaxCellText, kMaxCol, kMaxCols, kMaxPaletteEntry, kMaxRow, kMaxRows, kMaxSheet, kMaxSheets, kProtectStructure
 
Fields inherited from class com.f1j.mvc.Constants
kPaper10x14, kPaper11x17, kPaperA3, kPaperA4, kPaperA4Small, kPaperA5, kPaperB4, kPaperB5, kPaperCSheet, kPaperDSheet, kPaperEnv10, kPaperEnv11, kPaperEnv12, kPaperEnv14, kPaperEnv9, kPaperEnvB4, kPaperEnvB5, kPaperEnvB6, kPaperEnvC3, kPaperEnvC4, kPaperEnvC5, kPaperEnvC6, kPaperEnvC65, kPaperEnvDL, kPaperEnvItaly, kPaperEnvMonarch, kPaperEnvPersonal, kPaperESheet, kPaperExecutive, kPaperFanfoldLglGerman, kPaperFanfoldStdGerman, kPaperFanfoldUS, kPaperFolio, kPaperLedger, kPaperLegal, kPaperLetter, kPaperLetterSmall, kPaperNote, kPaperQuarto, kPaperStatement, kPaperTabloid
 
Method Summary
 void addColPageBreak(int col)
          Adds a vertical page break to the left edge of the specified column.
 GRObject addGRObject(short objectType, double x1, double y1, double x2, double y2)
          Deprecated. Replaced by com.f1j.drawing.Drawing.addShape(com.f1j.drawing.EAutoShape, com.f1j.drawing.ClientAnchor).
 void addRowPageBreak(int row)
          Adds a horizontal page break to the top edge of the specified row.
 void clearRange(int row1, int col1, int row2, int col2, short clearType)
          Clears the specified range without checking for locked cells or partial clearing of array entered formulas.
 void copyDataFromArray(int row1, int col1, int row2, int col2, double[][] data)
          Copies data from an array into a sheet.
 void copyDataToArray(int row1, int col1, int row2, int col2, double[][] data)
          Copies data from the sheet into an array.
 void copyRange(int dstRow1, int dstCol1, int dstRow2, int dstCol2, Sheet srcSheet, int srcRow1, int srcCol1, int srcRow2, int srcCol2, short what)
          Copies a range of data from one worksheet to another.
 void editCopy(int nRow1, int nCol1, int nRow2, int nCol2)
          Copies the specified range to the clipboard.
 void editCut(int nRow1, int nCol1, int nRow2, int nCol2)
          Cuts the specified range to the clipboard.
 void editPaste(int nRow1, int nCol1, int nRow2, int nCol2, boolean bDone)
          Pastes data from the clipboard to the specified range.
 void editPasteSpecial(int nRow1, int nCol1, int nRow2, int nCol2, short what)
          Pastes data from the clipboard to the specified range.
 RangeRef getActiveRange()
          Returns the range of the worksheet that is occupied by data.
 RangeRef getArrayFormulaRange(int row, int col)
          Returns the array formula range of the specified cell.
 AutoFilter getAutoFilter()
          Returns the AutoFilter that is on this worksheet or null if there is no AutoFilter.
 Book getBook()
          Returns the workbook containing this worksheet.
 java.lang.String getCodeName()
          Returns the VBA object name of the worksheet.
 int getColOutlineLevel(int col)
          Returns the outline level of a single specified column.
 short getColOutlineType(int col)
          Returns the outline type of a single specified column.
 java.lang.String getColText(int col)
          Returns the label for a column.
 int getColWidth(int col)
          Returns the width of a single column.
 DataRange getDataRange(int index)
          Returns the DataRange at the specified index.
 DataRangeCollection getDataRangeCollection()
          Returns the DataRangeCollection for this sheet.
 int getDataRangeCount()
          Returns the number of DataRanges on this worksheet.
 int getDefaultColWidth()
          Returns the default column width.
 DataSet getDefaultDataSet()
          Returns the default DataSet for this sheet.
 int getDefaultRowHeight()
          Returns the default height for rows.
 Drawing getDrawing()
          Returns a reference to the drawing.
 java.lang.String getEntry(int row, int col)
          Returns the text value of the specified cell in the current worksheet in edit mode format.
 java.lang.String getEntry(java.lang.String location)
          Returns the value of the specified cell in edit mode format.
 GRObject getFirstGRObject()
          Deprecated.  
 java.lang.String getFormattedText(int row, int col)
          Returns the formatted text value of the specified cell.
 java.lang.String getFormula(int row, int col)
          Returns the text of the formula of the specified cell, in US English.
 GRObject getGRObject(int objectID)
          Deprecated. Replaced by com.f1j.drawing.Drawing.getShape(int).
 GRObject getGRObject(java.lang.String objectName)
          Deprecated.  
 int getHeaderHeight()
          Returns the height of the column headers.
 int getHeaderWidth()
          Returns the width of the row headers.
 short getHiddenState()
          Returns the hidden state for the sheet.
 java.lang.String getHyperlinkText(int nRow, int nCol)
          Retrieves the text of the hyperlink at the specified cell location.
 java.lang.String getHyperlinkToolTipText(int nRow, int nCol)
          Retrieves the hyperlink tool tip text for the specified cell location.
 int getHyperlinkType(int nRow, int nCol)
          Retrieves the type of the hyperlink at the specified cell location.
 int getLastCol()
          Returns the number of the last occupied column for this sheet.
 int getLastColForRow(int row)
          Returns the number of the last occupied column in the specified row.
 int getLastDataCol()
          Returns the number of the last occupied column for this sheet.
 int getLastDataColForRow(int row)
          Returns the number of the last occupied column in the specified row.
 int getLastDataRow()
          Returns the number of the last occupied row.
 int getLastRow()
          Returns the number of the last row that is not empty, including cells that contain only formatting.
 boolean getLogical(int row, int col)
          Returns the logical (true or false) value of the specified cell.
 java.lang.String getName()
          Returns the name of the worksheet.
 double getNumber(int row, int col)
          Returns the numeric value of the specified cell.
 PivotRange getPivotRange(int index)
          Returns the PivotRange at the specified index.
 int getPivotRangeCount()
          Returns the number of PivotRanges on this worksheet.
 int getProtectionFlags()
          Returns a set of flags indicating which actions are allowed when sheet protection is enabled.
 Range getRange(int row1, int col1, int row2, int col2)
          Returns a Range object for the specified coordinates.
 SheetProperties getReportFunctionsProperties()
          Returns the Report Functions properties associated with this sheet.
 int getRowHeight(int row)
          Returns the height of a single specified row.
 int getRowOutlineLevel(int row)
          Returns the outline level of a single specified row.
 short getRowOutlineType(int row)
          Returns the outline type of a single specified row.
 java.lang.String getRowText(int row)
          Returns the name of the specified row.
 int getSheetNumber()
          Returns the ordinal number of this worksheet within the workbook that contains it.
 short getSheetType()
          Returns the sheet type.
 java.lang.String getText(int row, int col)
          Returns the text value of the specified cell.
 java.lang.String getTopLeftText()
          Returns the text displayed at the intersection of the row and column headings in the top left corner.
 short getType(int row, int col)
          Returns the cell type of the specified cell.
 boolean hasAutoFilter()
          true if the AutoFilter drop-down arrows are currently displayed on the worksheet.
 boolean hasDrawing()
          Returns true if the sheet currently has a drawing.
 boolean isAllowed(int protectionFlags)
          Returns true if the sheet is not protected or if the sheet's current protection settings allow all of the specified actions.
 boolean isArrayFormula(int row, int col)
          Returns true if the specified cell is part of an array formula.
 boolean isEnableProtection()
          Deprecated. Replaced by #isProtected.
 boolean isFiltering()
          Indicates whether this worksheet is in filter mode.
 boolean isHyperlink(int nRow, int nCol)
          Returns true if the cell at the specified position contains a hyperlink.
 boolean isLotusEvaluation()
          Returns a flag indicating whether to evaluate formulas in a fashion compatible with Lotus 123.
 boolean isPasswordProtected()
          Returns true if protection is enabled with a password for this sheet.
 boolean isProtected()
          Returns true if protection is enabled for this sheet.
 boolean isRowHidden(int row)
          Returns true if the row is hidden.
 void removeGRObject(GRObject object)
          Deprecated. Replaced by com.f1j.drawing.Shape.delete().
 void setArrayFormula(int row1, int col1, int row2, int col2, java.lang.String formula)
          Sets the formula for the specified range to an array formula.
 void setCodeName(java.lang.String codeName)
          Assigns a VBA object name to this worksheet.
 void setColOutlineCollapsed(int col, boolean collapsed)
          Sets whether an outline group is collapsed or expanded.
 void setColOutlineLevel(int col1, int col2, int outlineLevel, boolean additive)
          Sets the outline level of a range of columns.
 void setColText(int col, java.lang.String colText)
          Sets the label for a column.
 void setDefaultDataSet(DataSet dataSet)
          Sets the default DataSet for this sheet.
 void setEnableProtection(boolean enableProtection)
          Deprecated. Replaced by setProtection(boolean, String, int).
 void setEnableProtection(boolean enableProtection, java.lang.String password)
          Deprecated. Replaced by setProtection(boolean, String, int).
 void setEntry(int row, int col, java.lang.String entry)
          Sets the value of a specified cell of all selected worksheets.
 void setEntry(java.lang.String location, java.lang.String entry)
          Sets the value of a specified cell.
 void setFormula(int row, int col, java.lang.String formula)
          Sets the formula for the specified cell.
 void setHiddenState(short hiddenState)
          Sets the hidden state for the sheet.
 void setLogical(int row, int col, boolean logical)
          Sets the logical (true or false) value of the specified cell.
 void setLotusEvaluation(boolean lotusEvaluation)
          Sets a flag indicating whether to evaluate formulas in a fashion compatible with Lotus 123.
 void setName(java.lang.String sheetName)
          Assigns a name to this worksheet.
 void setNumber(int row, int col, double number)
          Sets the numeric value of the specified cell.
 void setProtection(boolean enableProtection, java.lang.String password, int flags)
          Sets whether protection is enabled for this sheet.
 void setReportFunctionsProperties(SheetProperties properties)
          Sets the Report Functions properties that should be associated with this sheet.
 void setRowOutlineCollapsed(int row, boolean collapsed)
          Sets whether an outline group is collapsed or expanded.
 void setRowOutlineLevel(int row1, int row2, int outlineLevel, boolean additive)
          Sets the outline level of a range of rows.
 void setRowText(int row, java.lang.String rowText)
          Sets the name for the specified row.
 void setSheetType(short sheetType)
          Sets the sheet type.
 void setText(int row, int col, java.lang.String text)
          Sets the value of the specified cell for all selected sheets.
 void setTopLeftText(java.lang.String topLeftText)
          Sets the text displayed at the intersection of the row and column headings in the top left corner of this worksheet.
 void showAllData()
          Makes all rows of the currently filtered list visible.
 void sort(int row1, int col1, int row2, int col2, boolean sortByRows, int[] keys)
          Specifies a range of data to sort and the keys by which to sort it.
 

Method Detail

addColPageBreak

public void addColPageBreak(int col)
Adds a vertical page break to the left edge of the specified column.
Parameters:
col - indicates the column where the page break is added.
See Also:
addRowPageBreak(int)

addGRObject

public GRObject addGRObject(short objectType,
                            double x1,
                            double y1,
                            double x2,
                            double y2)
                     throws F1Exception
Deprecated. Replaced by com.f1j.drawing.Drawing.addShape(com.f1j.drawing.EAutoShape, com.f1j.drawing.ClientAnchor).
Creates and adds an object to the active worksheet.
Parameters:
objectType - identifies the type of object to be created.
x1 - coordinate of the first anchor point of the object. x1 is measured in columns from the left edge of the worksheet.
y1 - coordinate of the first anchor point of the object. y1 is measured in rows from the top edge of the worksheet.
x2 - coordinate of the second anchor point. x2 is measured in columns from the left edge of the worksheet.
y2 - coordinate of the second anchor point. y2 is measured in rows from the top edge of the worksheet.
Returns:
an object.
Throws:
F1Exception - if the object list is full.

addRowPageBreak

public void addRowPageBreak(int row)
Adds a horizontal page break to the top edge of the specified row.
Parameters:
row - index number of the row where the page break is added. Rows are indexed from top to bottom beginning with 0

clearRange

public void clearRange(int row1,
                       int col1,
                       int row2,
                       int col2,
                       short clearType)
                throws F1Exception
Clears the specified range without checking for locked cells or partial clearing of array entered formulas.

Rows are indexed from top to bottom beginning with 0; sheets and columns are indexed from left to right beginning with 0.

Parameters:
row1 - Coordinate specifying the beginning row of the range.
col1 - Coordinate specifying the beginning column of the range.
row2 - Coordinate specifying the ending row of the range.
col2 - Coordinate specifying the ending column of the range.
clearType - Determines what is cleared, as follows:
  eClearFormats - clears formats only.
  eClearContents - clears values and formulas, including report range and pivot range content.
  eClearAll - clears all contents and formatting.
Throws:
F1Exception - if the object list is full.
See Also:
copyRange(int, int, int, int, com.f1j.ss.Sheet, int, int, int, int, short)

copyDataFromArray

public void copyDataFromArray(int row1,
                              int col1,
                              int row2,
                              int col2,
                              double[][] data)
                       throws F1Exception
Copies data from an array into a sheet.

The array and the sheet do not have to be the same size.

Rows are indexed from top to bottom beginning with 0; sheets and columns are indexed from left to right beginning with 0.

Parameters:
row1 - the coordinate specifying the beginning row to copy to.
col1 - the coordinate specifying the beginning column to copy to.
row2 - the coordinate of the ending row.
col2 - the coordinate of the ending column.
data - a 2-dimensional array to copy from.
Throws:
F1Exception - if a parameter is invalid.
See Also:
copyDataToArray(int, int, int, int, double[][])

copyDataToArray

public void copyDataToArray(int row1,
                            int col1,
                            int row2,
                            int col2,
                            double[][] data)
                     throws F1Exception
Copies data from the sheet into an array.

The array and the sheet range do not have to be the same size.

Rows are indexed from top to bottom beginning with 0; sheets and columns are indexed from left to right beginning with 0.

Parameters:
row1 - the coordinate of the beginning row.
col1 - the coordinate of the beginning column.
row2 - the coordinate of the ending row.
col2 - the coordinate of the ending column.
data - a 2-dimensional array to receive the data.
Throws:
F1Exception - if a parameter is invalid.
See Also:
copyDataFromArray(int, int, int, int, double[][])

copyRange

public void copyRange(int dstRow1,
                      int dstCol1,
                      int dstRow2,
                      int dstCol2,
                      Sheet srcSheet,
                      int srcRow1,
                      int srcCol1,
                      int srcRow2,
                      int srcCol2,
                      short what)
               throws F1Exception
Copies a range of data from one worksheet to another.

this method allows you to choose the type of data to copy: formulas and data only, values only (w/o the formulas that created the value), formats only, or any combination of the previous types.

Rows are indexed from top to bottom beginning with 0; sheets and columns are indexed from left to right beginning with 0.

Note: this method does not check to see whether the workbook containing the source data needs to be recalculated. if you are copying values, not copying formulas from a range which may contain formulas, and not sure that the workbook containing this source range has been recalculated, you should call the checkRecalc method.

Parameters:
dstRow1 - the first row in the destination range.
dstCol1 - the first column in the destination range.
dstRow2 - the ending row in the destination range, inclusive.
dstCol2 - the ending column in the destination range, inclusive.
srcSheet - identifyies the source worksheet.
srcRow1 - the first row in the source range.
srcCol1 - the first column in the source range.
srcRow2 - the ending row in the source range, inclusive.
srcCol2 - the ending column in the source range, inclusive.
what - the type of copy operation, using one or more of the following constants:
    eCopyFormulas = 1
    eCopyValues   = 2
    eCopyFormats  = 4
    eCopyAll      = 7
Throws:
F1Exception - if a parameter is invalid.
See Also:
clearRange(int, int, int, int, short)

editCopy

public void editCopy(int nRow1,
                     int nCol1,
                     int nRow2,
                     int nCol2)
              throws DataConflictException,
                     F1Exception
Copies the specified range to the clipboard.
Parameters:
nRow1 - first row
nCol1 - first col
nRow2 - last row
nCol2 - last col
Throws:
DataConflictException - if copying the range would conflict with existing data.
F1Exception - if an error occurs.
Since:
11.0
See Also:
editCut(int, int, int, int), editPaste(int, int, int, int, boolean), editPasteSpecial(int, int, int, int, short)

editCut

public void editCut(int nRow1,
                    int nCol1,
                    int nRow2,
                    int nCol2)
             throws DataConflictException,
                    F1Exception
Cuts the specified range to the clipboard.
Parameters:
nRow1 - first row
nCol1 - first col
nRow2 - last row
nCol2 - last col
Throws:
DataConflictException - if copying the range would conflict with existing data.
F1Exception - if an error occurs.
Since:
11.0
See Also:
editCopy(int, int, int, int), editPaste(int, int, int, int, boolean), editPasteSpecial(int, int, int, int, short)

editPaste

public void editPaste(int nRow1,
                      int nCol1,
                      int nRow2,
                      int nCol2,
                      boolean bDone)
               throws AccessDeniedException,
                      DataConflictException,
                      InvalidArgumentException,
                      F1Exception
Pastes data from the clipboard to the specified range.
Parameters:
nRow1 - first row
nCol1 - first col
nRow2 - last row
nCol2 - last col
bDone - true if the clipboard should be cleared after this operation
Throws:
DataConflictException - if copying the range would conflict with existing data.
F1Exception - if an error occurs.
Since:
11.0
See Also:
editCopy(int, int, int, int), editCut(int, int, int, int), editPasteSpecial(int, int, int, int, short)

editPasteSpecial

public void editPasteSpecial(int nRow1,
                             int nCol1,
                             int nRow2,
                             int nCol2,
                             short what)
                      throws AccessDeniedException,
                             DataConflictException,
                             InvalidArgumentException,
                             F1Exception
Pastes data from the clipboard to the specified range.

this method allows you to choose the type of data to paste: formulas only, values only, formats only, any combination of the previous types, or all of the types.

Parameters:
nRow1 - first row
nCol1 - first col
nRow2 - last row
nCol2 - last col
what - what to paste, represented as one or more of the following constants:
             eCopyFormulas = 1
             eCopyValues   = 2
             eCopyFormats  = 4
             eCopyAll      = 7
Throws:
DataConflictException - if copying the range would conflict with existing data.
F1Exception - if an error occurs.
Since:
11.0
See Also:
editCopy(int, int, int, int), editCut(int, int, int, int), editPaste(int, int, int, int, boolean)

getActiveRange

public RangeRef getActiveRange()
Returns the range of the worksheet that is occupied by data.
Returns:
the occupied range of the worksheet.

getArrayFormulaRange

public RangeRef getArrayFormulaRange(int row,
                                     int col)
Returns the array formula range of the specified cell.
Parameters:
row - the row of the specified cell.
col - the column of the specified cell.
Returns:
the array formula range of the specified cell. Returns null if the cell does not contain an array formula.

getBook

public Book getBook()
Returns the workbook containing this worksheet.
Returns:
the Book this worksheet is in.

getColOutlineLevel

public int getColOutlineLevel(int col)
Returns the outline level of a single specified column.
Parameters:
col - the column number.
Returns:
the outline level of the specified column.
See Also:
getRowOutlineLevel(int), setColOutlineLevel(int, int, int, boolean), setRowOutlineLevel(int, int, int, boolean)

getColOutlineType

public short getColOutlineType(int col)
Returns the outline type of a single specified column.
Parameters:
col - the column number.
Returns:
the outline type of the specified column. this is either eOutlineTerminal, eOutlineExpanded or eOutlineCollapsed.
See Also:
getColOutlineLevel(int), setColOutlineLevel(int, int, int, boolean), setColOutlineCollapsed(int, boolean)

getColWidth

public int getColWidth(int col)
Returns the width of a single column.

Column width can be specified in units equal to 1/256th of the character 0's width in the default font, or in twips, depending on the column width units specified for the workbook.

Parameters:
col - identifies a column by number.
Returns:
the column width value.
See Also:
BookModel.setColWidth(int, int, int, boolean)

getColText

public java.lang.String getColText(int col)
Returns the label for a column.
Parameters:
col - identifies a column by number.
Returns:
the column label text, or null if no column text has been set.
See Also:
setColText(int, java.lang.String)

getDataRangeCollection

public DataRangeCollection getDataRangeCollection()
Returns the DataRangeCollection for this sheet.
Returns:
the data range collection for this sheet.
See Also:
DataRangeCollection

getDefaultColWidth

public int getDefaultColWidth()
Returns the default column width.
Returns:
the default column width value.

getDefaultRowHeight

public int getDefaultRowHeight()
Returns the default height for rows.
Returns:
the row height value in twips. A twip is 1/1440th of an inch.
See Also:
getRowHeight(int)

getDrawing

public Drawing getDrawing()

Returns a reference to the drawing.

if the sheet does not have a drawing, one is created. In some applications the automatic creation of a drawing may be undesirable because of memory footprint or file size concerns. if this is the case, call hasDrawing to determine whether the sheet has a drawing prior to calling this method.

Returns:
the drawing for this sheet.
See Also:
hasDrawing()

getEntry

public java.lang.String getEntry(int row,
                                 int col)
Returns the text value of the specified cell in the current worksheet in edit mode format.

for example, if the cell contains a formula, the text of the formula is displayed. Returned formulas are preceded by an equal sign (=).

Note: The returned string is always in the user's language and should only be used for interaction with the user.

Parameters:
row - the row number.
col - the column number.
Returns:
a string containing the cell contents.
See Also:
setEntry(int, int, java.lang.String)

getEntry

public java.lang.String getEntry(java.lang.String location)
                          throws F1Exception
Returns the value of the specified cell in edit mode format.

for example, if the cell contains a formula, the text of the formula is returned. Returned formulas are preceded by an equal sign (=).

Note: The returned string is always in the user's language and should only be used for interaction with the user.

Parameters:
location - a defined name or a reference that identifies a cell.
Returns:
a string containing the cell contents.
Throws:
F1Exception - when an exception occurs.
See Also:
setEntry(int, int, java.lang.String)

getFirstGRObject

public GRObject getFirstGRObject()
Deprecated.  
Returns the first graphics object on a worksheet or null if there are none.
Returns:
the first graphics object on a worksheet or null if there are none.

getFormattedText

public java.lang.String getFormattedText(int row,
                                         int col)
                                  throws F1Exception
Returns the formatted text value of the specified cell.

this method returns the text as it is seen in the worksheet, including all formatting. To return unformatted text, use the getText or getEntry methods.

Parameters:
row - the row number of the cell from which the text is returned.
col - the column number of the cell from which the text is returned.
Returns:
a string containing the formatted text.
Throws:
F1Exception - when an exception occurs.
See Also:
getText(int, int), getEntry(int, int)

getFormula

public java.lang.String getFormula(int row,
                                   int col)
                            throws F1Exception
Returns the text of the formula of the specified cell, in US English.
Parameters:
row - the row number of the cell.
col - the column number of the cell.
Returns:
the formula of the specified cell.
Throws:
F1Exception - when an exception occurs.
See Also:
setFormula(int, int, java.lang.String)

getGRObject

public GRObject getGRObject(int objectID)
Deprecated. Replaced by com.f1j.drawing.Drawing.getShape(int).
Returns an object specified by its identification number.
Parameters:
objectID - the object's identification number.
Returns:
the specified object or null if no object is found.
See Also:
addGRObject(short, double, double, double, double), removeGRObject(com.f1j.ss.GRObject)

getGRObject

public GRObject getGRObject(java.lang.String objectName)
Deprecated.  
Returns an object specified by name.
Parameters:
objectName - the name of the object.
Returns:
the specified object or null if no object is found.
See Also:
addGRObject(short, double, double, double, double), removeGRObject(com.f1j.ss.GRObject)

getHeaderHeight

public int getHeaderHeight()
Returns the height of the column headers.

Header height is specified in twips. A twip is 1/1440 of an inch.

Returns:
the header height.
See Also:
getHeaderWidth()

getHeaderWidth

public int getHeaderWidth()
Returns the width of the row headers.

The units used to store or display widths depends on the value of the colWidthUnits setting. if the units are set to characters, the width is specified in units equal to 1/256th of the 0 character's width in the default font. if the units are set to twips, columns are measured in twips, which are 1/1440 of an inch.

Returns:
the width of the row headers.
See Also:
getHeaderHeight()

getHiddenState

public short getHiddenState()
Returns the hidden state for the sheet.
Returns:
the hidden state for the sheet:
Hidden State Flags
Tag Description
eSheetShown show the sheet.
eSheetHidden hide the sheet.
eSheetVeryHidden hide the sheet and disable the ability to reshow the sheet with the GUI.
See Also:
setHiddenState(short)

getHyperlinkText

public java.lang.String getHyperlinkText(int nRow,
                                         int nCol)
                                  throws F1Exception
Retrieves the text of the hyperlink at the specified cell location.
Parameters:
nRow - the row of the cell to inspect
nCol - the column of the cell to inspect
Returns:
the hyperlink text (the qualified link).
Throws:
F1Exception - if no hyperlink is found at the specified position

getHyperlinkToolTipText

public java.lang.String getHyperlinkToolTipText(int nRow,
                                                int nCol)
                                         throws F1Exception
Retrieves the hyperlink tool tip text for the specified cell location.
Parameters:
nRow - the row of the cell to inspect
nCol - the column of the cell to inspect
Returns:
Tool tip text of the hyperlink at the specified position
Throws:
F1Exception - if no hyperlink is found at the specified position

getHyperlinkType

public int getHyperlinkType(int nRow,
                            int nCol)
                     throws F1Exception
Retrieves the type of the hyperlink at the specified cell location.
Parameters:
nRow - the row of the cell to inspect
nCol - the column of the cell to inspect
Returns:
the hyperlink type
Throws:
F1Exception - if no hyperlink is found at the specified position

getLastCol

public int getLastCol()
Returns the number of the last occupied column for this sheet.

this method returns the last column that is not empty, including cells that contain only formatting.

Returns:
the last occupied column.
See Also:
getLastColForRow(int), getLastDataCol(), getLastDataRow(), getLastDataColForRow(int), getLastRow()

getLastColForRow

public int getLastColForRow(int row)
Returns the number of the last occupied column in the specified row.

this method returns the last column that is not empty, including cells that contain only formatting. -1 is returned for a row with no cells.

Parameters:
row - the specified row.
Returns:
the last occupied column in the row or -1 for an empty row.
See Also:
getLastCol(), getLastDataCol(), getLastDataRow(), getLastDataColForRow(int), getLastRow()

getLastDataCol

public int getLastDataCol()
Returns the number of the last occupied column for this sheet.

this method returns the last column that contains data, ignoring cells that contain only formatting. -1 is returned for a row with no data cells.

Returns:
the last occupied column.
See Also:
getLastCol(), getLastColForRow(int), getLastDataRow(), getLastDataColForRow(int), getLastRow()

getLastDataColForRow

public int getLastDataColForRow(int row)
Returns the number of the last occupied column in the specified row.

this method returns the last column that contains data, ignoring cells that contain only formatting. -1 is returned for a row with no data cells.

Parameters:
row - the specified row.
Returns:
the last occupied column in the row or -1 for an empty row.
See Also:
getLastCol(), getLastColForRow(int), getLastDataCol(), getLastDataRow(), getLastRow()

getLastDataRow

public int getLastDataRow()
Returns the number of the last occupied row.

this method returns the last row that contains data, ignoring cells that contain only formatting. -1 is returned if the sheet contains no data cells.

Returns:
the number of the last row.
See Also:
getLastCol(), getLastColForRow(int), getLastDataCol(), getLastDataColForRow(int), getLastRow()

getLastRow

public int getLastRow()
Returns the number of the last row that is not empty, including cells that contain only formatting. The value -1 is returned if the sheet contains no cells.
Returns:
the number of the last row.
See Also:
getLastCol(), getLastColForRow(int), getLastDataCol(), getLastDataRow(), getLastDataColForRow(int)

getLogical

public boolean getLogical(int row,
                          int col)
                   throws F1Exception
Returns the logical (true or false) value of the specified cell.

if the cell contains a number, its logical value is true for non-zero values, and false for zero values. if the cell has text that can be converted to a number, the text is converted and treated as a numeric cell. if the cell contains a formula, the above rules apply depending on the formula's result. All other cells, including empty cells, have a false logical value.

Parameters:
row - identifies the row by number.
col - identifies the column by number.
Returns:
true/false.
Throws:
F1Exception - when an exception occurs.
See Also:
setLogical(int, int, boolean)

getNumber

public double getNumber(int row,
                        int col)
Returns the numeric value of the specified cell.

Cells containing a formula return the numeric result of the formula. if a cell contains text, an attempt is made to convert the text to a number. if the text cannot be converted, 0 (No Error) is returned.

Parameters:
row - the row coordinate.
col - the column coordinate.
Returns:
the numeric value of the specified cell.
See Also:
setNumber(int, int, double)

getProtectionFlags

public int getProtectionFlags()
Returns a set of flags indicating which actions are allowed when sheet protection is enabled.
Returns:
kAllowNone if nothing is allowed, or one or more of the following flags:
 kAllowDefault
 kAllowEditObjects
 kAllowFormatCells
 kAllowFormatColumns
 kAllowFormatRows
 kAllowInsertColumns
 kAllowInsertRows
 kAllowInsertHyperlinks
 kAllowDeleteColumns
 kAllowDeleteRows
 kAllowSelectLocked
 kAllowSort
 kAllowUseAutoFilter
 kAllowUsePivotRanges
 kAllowSelectUnlocked
 
See Also:
isProtected(), isPasswordProtected(), setProtection(boolean, java.lang.String, int), isAllowed(int), BookModel.getSheetProtectionFlags(int), Book.getProtectionFlags()

getRowText

public java.lang.String getRowText(int row)
Returns the name of the specified row.

Naming a row is useful for providing labels that reflect the data in the row. The row name is displayed in the row heading is used for display purposes only. The row is still referred to by normal cell references in formulas. Row names can be up to 254 characters long.

Parameters:
row - the row number.
Returns:
a string containing the row name.
See Also:
setRowText(int, java.lang.String)

getName

public java.lang.String getName()
Returns the name of the worksheet.
Returns:
the name of the worksheet.
See Also:
setName(java.lang.String), getCodeName()

getCodeName

public java.lang.String getCodeName()
Returns the VBA object name of the worksheet.
Returns:
the VBA object name of the worksheet.
Since:
11.0.1
See Also:
setCodeName(java.lang.String), getName()

getRowOutlineLevel

public int getRowOutlineLevel(int row)
Returns the outline level of a single specified row.
Parameters:
row - the row number.
Returns:
the outline level of the specified row.
See Also:
getColOutlineLevel(int), setColOutlineLevel(int, int, int, boolean), setRowOutlineLevel(int, int, int, boolean)

getRowOutlineType

public short getRowOutlineType(int row)
Returns the outline type of a single specified row.
Parameters:
row - the row number.
Returns:
the outline type of the specified row. this is either eOutlineTerminal, eOutlineExpanded or eOutlineCollapsed.
See Also:
getRowOutlineLevel(int), setRowOutlineLevel(int, int, int, boolean), setRowOutlineCollapsed(int, boolean)

getRowHeight

public int getRowHeight(int row)
Returns the height of a single specified row.
Parameters:
row - the row number.
Returns:
the row height in twips. A twip is 1/1440th of an inch.
See Also:
getDefaultRowHeight()

getSheetNumber

public int getSheetNumber()
Returns the ordinal number of this worksheet within the workbook that contains it.
Returns:
the ordinal number of this worksheet within the workbook that contains it.

getSheetType

public short getSheetType()
Returns the sheet type.
Returns:
one of the following sheet types:
          eSheetTypeSheet
          eSheetTypeChart
See Also:
setSheetType(short)

isAllowed

public boolean isAllowed(int protectionFlags)
Returns true if the sheet is not protected or if the sheet's current protection settings allow all of the specified actions.
Parameters:
protectionFlags - One or more of the following flags:
 kAllowDefault
 kAllowEditObjects
 kAllowFormatCells
 kAllowFormatColumns
 kAllowFormatRows
 kAllowInsertColumns
 kAllowInsertRows
 kAllowInsertHyperlinks
 kAllowDeleteColumns
 kAllowDeleteRows
 kAllowSelectLocked
 kAllowSort
 kAllowUseAutoFilter
 kAllowUsePivotRanges
 kAllowSelectUnlocked
 
Returns:
boolean. true/false.
See Also:
getProtectionFlags(), setProtection(boolean, java.lang.String, int), isProtected(), isPasswordProtected(), BookModel.isAllowedSheetAction(int), Book.isProhibited(int)

isArrayFormula

public boolean isArrayFormula(int row,
                              int col)
Returns true if the specified cell is part of an array formula.
Parameters:
row - specifies the row of the cell.
col - specifies the column of the cell.
Returns:
true if the specified cell is part of an array formula.
See Also:
getArrayFormulaRange(int, int), getFormula(int, int)

isRowHidden

public boolean isRowHidden(int row)
Returns true if the row is hidden.
Parameters:
row - identifies a row by number. Rows are indexed from top to bottom beginning at 0.
Returns:
boolean. true/false

getText

public java.lang.String getText(int row,
                                int col)
Returns the text value of the specified cell.
Parameters:
row - identifies the cell row by number.
col - identifies the cell column by number.
Returns:
the text value of the specified cell.
See Also:
setText(int, int, java.lang.String)

getTopLeftText

public java.lang.String getTopLeftText()
Returns the text displayed at the intersection of the row and column headings in the top left corner.
Returns:
the top left corner text.
See Also:
setTopLeftText(java.lang.String)

getType

public short getType(int row,
                     int col)
Returns the cell type of the specified cell.
Parameters:
row - identifies the cell row by number.
col - identifies the cell column by number.
Returns:
one of the following cell types:
       com.f1j.ss.Book.eTypeEmpty
       com.f1j.ss.Book.eTypeNumber
       com.f1j.ss.Book.eTypeText
       com.f1j.ss.Book.eTypeLogical
       com.f1j.ss.Book.eTypeError
 
A negative value indicates that the cell contains a formula.
See Also:
Selection.setType(short), ConditionalFormat.setType(short)

hasDrawing

public boolean hasDrawing()

Returns true if the sheet currently has a drawing.

In applications where the presence of an empty drawing is considered undesirable because of memory footprint or file size concerns, this method should be called to see whether a drawing already exists in the sheet. this way the application can avoid a call to the getDrawing method, which would automatically create a drawing.

Returns:
true/false
See Also:
getDrawing()

isEnableProtection

public boolean isEnableProtection()
Deprecated. Replaced by #isProtected.
Returns true if protection is enabled for this sheet.

Enabling protection means that any cells marked as hidden or locked are actually hidden and locked.

Returns:
boolean. true/false.
See Also:
isPasswordProtected(), setEnableProtection(boolean)

isProtected

public boolean isProtected()
Returns true if protection is enabled for this sheet.

Enabling protection means that any cells marked as hidden or locked are actually hidden and locked.

Returns:
boolean. true/false.
See Also:
isPasswordProtected(), setProtection(boolean, java.lang.String, int), getProtectionFlags(), isAllowed(int), BookModel.isSheetProtected(int), Book.isProtected()

isHyperlink

public boolean isHyperlink(int nRow,
                           int nCol)
Returns true if the cell at the specified position contains a hyperlink.
Parameters:
nRow - index of row that cell is on
nCol - index of column that cell is on
Returns:
boolean. true/false.

isLotusEvaluation

public boolean isLotusEvaluation()
Returns a flag indicating whether to evaluate formulas in a fashion compatible with Lotus 123.
Returns:
the flag indicating whether to evaluate formulas in a fashion compatible with Lotus 123.
See Also:
setLotusEvaluation(boolean)

isPasswordProtected

public boolean isPasswordProtected()
Returns true if protection is enabled with a password for this sheet. this method returns false if protection is enabled without a password. Enabling protection means that any cells marked as hidden or locked are actually hidden and locked.
Returns:
boolean. true/false.
See Also:
isProtected(), setProtection(boolean, java.lang.String, int), getProtectionFlags(), isAllowed(int), BookModel.isSheetPasswordProtected(int), Book.isPasswordProtected()

removeGRObject

public void removeGRObject(GRObject object)
                    throws F1Exception
Deprecated. Replaced by com.f1j.drawing.Shape.delete().
Removes the specified object.
Parameters:
object - the GRObject to remove.
Throws:
F1Exception - if the object is not found.
See Also:
addGRObject(short, double, double, double, double)

setArrayFormula

public void setArrayFormula(int row1,
                            int col1,
                            int row2,
                            int col2,
                            java.lang.String formula)
                     throws F1Exception
Sets the formula for the specified range to an array formula.
Parameters:
row1 - the first row in the range.
col1 - the first column in the range.
row2 - the last row in the range.
col2 - the last column in the range.
formula - formula for the specified cell. The string should not have a leading equal sign (=).
Throws:
F1Exception - if the string is not a valid formula.
See Also:
getFormula(int, int), getArrayFormulaRange(int, int)

setColOutlineLevel

public void setColOutlineLevel(int col1,
                               int col2,
                               int outlineLevel,
                               boolean additive)
                        throws F1Exception
Sets the outline level of a range of columns.
Parameters:
col1 - the first column in the range.
col2 - the last column in the range.
outlineLevel - the outline level to set. The outline level may be set from zero to seven.
additive - boolean. Specifies whether the outline level is an absolute value to set or should be added to the current outline level. true = the value specified in the outlineLevel parameter is added to the current outline level of each column. false = the outline level of the specified columns is set to the value specified in the outlineLevel parameter.
Throws:
F1Exception - if the object list is full.
See Also:
getColOutlineLevel(int), getRowOutlineLevel(int), setRowOutlineLevel(int, int, int, boolean)

setColOutlineCollapsed

public void setColOutlineCollapsed(int col,
                                   boolean collapsed)
                            throws F1Exception
Sets whether an outline group is collapsed or expanded.
Parameters:
col - the column to expand or collapse. The column must currently have an outline type of eOutlineCollapsed or eOutlineExpanded.
collapsed - boolean. true = collapse the outline group. false = expand the outline group.
Throws:
F1Exception - if the object list is full.
See Also:
getColOutlineLevel(int), setColOutlineLevel(int, int, int, boolean), getColOutlineType(int)

setColText

public void setColText(int col,
                       java.lang.String colText)
                throws F1Exception
Sets the label for a column.

Naming a column is useful for labeling columns so they reflect the data in the column (e.g., column G might be named Total Sales). The column name is displayed in the column heading and is used for display purposes only. The column is still referred to by letter reference in formulas. The column name can be up to 9 lines and 254 bytes. A CR (carriage return) and LF (line feed) combination are counted as two characters.

Parameters:
col - identifies a column by number.
colText - the column label text.
See Also:
getColText(int)

setEnableProtection

public void setEnableProtection(boolean enableProtection)
Deprecated. Replaced by setProtection(boolean, String, int).
Sets whether protection is enabled for this sheet.

Enabling protection means that any cells marked as hidden or locked are actually hidden and locked.

Parameters:
enableProtection - boolean. Indicates whether protection is to be enabled.
Throws:
java.lang.reflect.UndeclaredThrowableException - if the sheet is protected with a password. The setProtection(boolean, String, int) method allows you to specify a password.
See Also:
isEnableProtection(), isPasswordProtected()

setEnableProtection

public void setEnableProtection(boolean enableProtection,
                                java.lang.String password)
                         throws F1Exception
Deprecated. Replaced by setProtection(boolean, String, int).
Sets whether protection is enabled for this sheet.

Enabling protection means that any cells marked as hidden or locked are actually hidden and locked.

Parameters:
enableProtection - boolean. Indicates whether protection is to be enabled.
password - The protection password. this may be null if no password is to be used.
Throws:
F1Exception - if password is invalid
See Also:
isEnableProtection(), isPasswordProtected()

setProtection

public void setProtection(boolean enableProtection,
                          java.lang.String password,
                          int flags)
                   throws AccessDeniedException,
                          InvalidArgumentException,
                          ReportPreviewException,
                          F1Exception
Sets whether protection is enabled for this sheet.

Enabling protection means that any cells marked as hidden or locked are actually hidden and locked.

Parameters:
enableProtection - boolean. Indicates whether protection is to be enabled.
password - The protection password. this may be null if no password is to be used.
flags - kAllowNone if nothing should be allowed, or one or more of the following:
 kAllowDefault
 kAllowEditObjects
 kAllowFormatCells
 kAllowFormatColumns
 kAllowFormatRows
 kAllowInsertColumns
 kAllowInsertRows
 kAllowInsertHyperlinks
 kAllowDeleteColumns
 kAllowDeleteRows
 kAllowSelectLocked
 kAllowSort
 kAllowUseAutoFilter
 kAllowUsePivotRanges
 kAllowSelectUnlocked
 
Throws:
AccessDeniedException - if the sheet is protected.
InvalidArgumentException - if the flags are invalid.
ReportPreviewException - if protection cannot be changed because the book is in Report Range preview mode.
F1Exception - if an error occurs.
Since:
11.0
See Also:
isProtected(), isPasswordProtected(), getProtectionFlags(), isAllowed(int), BookModel.setSheetProtection(int, boolean, java.lang.String, int), Book.setProtection(boolean, java.lang.String, int)

setEntry

public void setEntry(int row,
                     int col,
                     java.lang.String entry)
              throws F1Exception
Sets the value of a specified cell of all selected worksheets.

this method allows you to enter information in a cell just as a user would enter information. e.Spreadsheet automatically determines the kind of data entered (e.g., number, text, formula). e.Spreadsheet also recognizes dates, times, percentages, currency, fractions, and scientific notation and applies an appropriate number format. When setting formulas, precede the formula with an equal sign (=).

Note this value is always in the user's language and should only be used to interact with the user.

Parameters:
row - a row number that identifies a cell.
col - a column number that identifies a cell.
entry - a cell value.
Throws:
F1Exception - when an exception occurs.
See Also:
getEntry(int, int)

setEntry

public void setEntry(java.lang.String location,
                     java.lang.String entry)
              throws F1Exception
Sets the value of a specified cell.

this method allows you to enter information in a cell just as a user would enter information. e.Spreadsheet automatically determines the kind of data entered (e.g., number, text, formula). e.Spreadsheet also recognizes dates, times, percentages, currency, fractions, and scientific notation and applies an appropriate number format. When setting formulas, precede the formula with an equal sign (=).

Note this value is always in the user's language and should only be used to interact with the user.

Parameters:
location - a defined name or a reference that identifies a cell.
entry - a cell value.
Throws:
F1Exception - when an exception occurs.
See Also: