Package jxl
Interface Sheet
-
- All Known Subinterfaces:
WritableSheet
public interface SheetRepresents a sheet within a workbook. Provides a handle to the individual cells, or lines of cells (grouped by Row or Column)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description CellfindCell(java.lang.String contents)Gets the cell whose contents match the string passed in.CellfindCell(java.lang.String contents, int firstCol, int firstRow, int lastCol, int lastRow, boolean reverse)Gets the cell whose contents match the string passed in.CellfindCell(java.util.regex.Pattern pattern, int firstCol, int firstRow, int lastCol, int lastRow, boolean reverse)Gets the cell whose contents match the regular expressionstring passed in.LabelCellfindLabelCell(java.lang.String contents)Gets the cell whose contents match the string passed in.CellgetCell(int column, int row)Returns the cell specified at this row and at this column.CellgetCell(java.lang.String loc)Returns the cell for the specified location eg.Cell[]getColumn(int col)Gets all the cells on the specified columnCellFormatgetColumnFormat(int col)Deprecated.Use getColumnView and the CellView bean insteadint[]getColumnPageBreaks()Accessor for the page breaks on this sheetintgetColumns()Returns the number of columns in this sheetCellViewgetColumnView(int col)Gets the column width for the specified columnintgetColumnWidth(int col)Deprecated.Use getColumnView insteadImagegetDrawing(int i)Accessor for the imageHyperlink[]getHyperlinks()Gets the hyperlinks on this sheetRange[]getMergedCells()Gets the cells which have been merged on this sheetjava.lang.StringgetName()Gets the name of this sheetintgetNumberOfImages()Accessor for the number of images on the sheetCell[]getRow(int row)Gets all the cells on the specified rowintgetRowHeight(int row)Deprecated.use getRowView insteadint[]getRowPageBreaks()Accessor for the page breaks on this sheetintgetRows()Returns the number of rows in this sheetCellViewgetRowView(int row)Gets the row height for the specified columnSheetSettingsgetSettings()Gets the settings used on a particular sheetbooleanisHidden()Deprecated.in favour of the getSettings() methodbooleanisProtected()Deprecated.in favour of the getSettings() method
-
-
-
Method Detail
-
getCell
Cell getCell(int column, int row)
Returns the cell specified at this row and at this column. If a column/row combination forms part of a merged group of cells then (unless it is the first cell of the group) a blank cell will be returned- Parameters:
column- the column numberrow- the row number- Returns:
- the cell at the specified co-ordinates
-
getCell
Cell getCell(java.lang.String loc)
Returns the cell for the specified location eg. "A4". Note that this method is identical to calling getCell(CellReferenceHelper.getColumn(loc), CellReferenceHelper.getRow(loc)) and its implicit performance overhead for string parsing. As such,this method should therefore be used sparingly- Parameters:
loc- the cell reference- Returns:
- the cell at the specified co-ordinates
-
getRows
int getRows()
Returns the number of rows in this sheet- Returns:
- the number of rows in this sheet
-
getColumns
int getColumns()
Returns the number of columns in this sheet- Returns:
- the number of columns in this sheet
-
getRow
Cell[] getRow(int row)
Gets all the cells on the specified row- Parameters:
row- the rows whose cells are to be returned- Returns:
- the cells on the given row
-
getColumn
Cell[] getColumn(int col)
Gets all the cells on the specified column- Parameters:
col- the column whose cells are to be returned- Returns:
- the cells on the specified column
-
getName
java.lang.String getName()
Gets the name of this sheet- Returns:
- the name of the sheet
-
isHidden
boolean isHidden()
Deprecated.in favour of the getSettings() methodDetermines whether the sheet is hidden- Returns:
- whether or not the sheet is hidden
-
isProtected
boolean isProtected()
Deprecated.in favour of the getSettings() methodDetermines whether the sheet is protected- Returns:
- whether or not the sheet is protected
-
findCell
Cell findCell(java.lang.String contents)
Gets the cell whose contents match the string passed in. If no match is found, then null is returned. The search is performed on a row by row basis, so the lower the row number, the more efficiently the algorithm will perform- Parameters:
contents- the string to match- Returns:
- the Cell whose contents match the paramter, null if not found
-
findCell
Cell findCell(java.lang.String contents, int firstCol, int firstRow, int lastCol, int lastRow, boolean reverse)
Gets the cell whose contents match the string passed in. If no match is found, then null is returned. The search is performed on a row by row basis, so the lower the row number, the more efficiently the algorithm will perform- Parameters:
contents- the string to matchfirstCol- the first column within the rangefirstRow- the first row of the rangelastCol- the last column within the rangelastRow- the last row within the rangereverse- indicates whether to perform a reverse search or not- Returns:
- the Cell whose contents match the parameter, null if not found
-
findCell
Cell findCell(java.util.regex.Pattern pattern, int firstCol, int firstRow, int lastCol, int lastRow, boolean reverse)
Gets the cell whose contents match the regular expressionstring passed in. If no match is found, then null is returned. The search is performed on a row by row basis, so the lower the row number, the more efficiently the algorithm will perform- Parameters:
pattern- the regular expression string to matchfirstCol- the first column within the rangefirstRow- the first row of the ranglastCol- the last column within the rangelastRow- the last row within the rangereverse- indicates whether to perform a reverse search or not- Returns:
- the Cell whose contents match the parameter, null if not found
-
findLabelCell
LabelCell findLabelCell(java.lang.String contents)
Gets the cell whose contents match the string passed in. If no match is found, then null is returned. The search is performed on a row by row basis, so the lower the row number, the more efficiently the algorithm will perform. This method differs from the findCell method in that only cells with labels are queried - all numerical cells are ignored. This should therefore improve performance.- Parameters:
contents- the string to match- Returns:
- the Cell whose contents match the paramter, null if not found
-
getHyperlinks
Hyperlink[] getHyperlinks()
Gets the hyperlinks on this sheet- Returns:
- an array of hyperlinks
-
getMergedCells
Range[] getMergedCells()
Gets the cells which have been merged on this sheet- Returns:
- an array of range objects
-
getSettings
SheetSettings getSettings()
Gets the settings used on a particular sheet- Returns:
- the sheet settings
-
getColumnFormat
CellFormat getColumnFormat(int col)
Deprecated.Use getColumnView and the CellView bean insteadGets the column format for the specified column- Parameters:
col- the column number- Returns:
- the column format, or NULL if the column has no specific format
-
getColumnWidth
int getColumnWidth(int col)
Deprecated.Use getColumnView insteadGets the column width for the specified column- Parameters:
col- the column number- Returns:
- the column width, or the default width if the column has no specified format
-
getColumnView
CellView getColumnView(int col)
Gets the column width for the specified column- Parameters:
col- the column number- Returns:
- the column format, or the default format if no override is specified
-
getRowHeight
int getRowHeight(int row)
Deprecated.use getRowView insteadGets the row height for the specified column- Parameters:
row- the row number- Returns:
- the row height, or the default height if the column has no specified format
-
getRowView
CellView getRowView(int row)
Gets the row height for the specified column- Parameters:
row- the row number- Returns:
- the row format, which may be the default format if no format is specified
-
getNumberOfImages
int getNumberOfImages()
Accessor for the number of images on the sheet- Returns:
- the number of images on this sheet
-
getDrawing
Image getDrawing(int i)
Accessor for the image- Parameters:
i- the 0 based image number- Returns:
- the image at the specified position
-
getRowPageBreaks
int[] getRowPageBreaks()
Accessor for the page breaks on this sheet- Returns:
- the page breaks on this sheet
-
getColumnPageBreaks
int[] getColumnPageBreaks()
Accessor for the page breaks on this sheet- Returns:
- the page breaks on this sheet
-
-