jxl.read.biff
Class SheetImpl

java.lang.Object
  extended byjxl.read.biff.SheetImpl
All Implemented Interfaces:
Sheet

public class SheetImpl
extends java.lang.Object
implements Sheet

Represents a sheet within a workbook. Provides a handle to the individual cells, or lines of cells (grouped by Row or Column) In order to simplify this class due to code bloat, the actual reading logic has been delegated to the SheetReaderClass. This class' main responsibility is now to implement the API methods declared in the Sheet interface


Method Summary
 Cell findCell(java.lang.String contents)
          Gets the cell whose contents match the string passed in.
 LabelCell findLabelCell(java.lang.String contents)
          Gets the cell whose contents match the string passed in.
 ButtonPropertySetRecord getButtonPropertySet()
          Accessor for the button property set, used during copying
 Cell getCell(int column, int row)
          Returns the cell specified at this row and at this column
 Cell getCell(java.lang.String loc)
          Returns the cell for the specified location eg.
 Chart[] getCharts()
          Gets the charts.
 Cell[] getColumn(int col)
          Gets all the cells on the specified column.
 CellFormat getColumnFormat(int col)
          Deprecated. use getColumnView instead
 ColumnInfoRecord getColumnInfo(int col)
          Gets the column info record for the specified column.
 ColumnInfoRecord[] getColumnInfos()
          Gets all the column info records
 int getColumns()
          Returns the number of columns in this sheet
 CellView getColumnView(int col)
          Gets the column width for the specified column
 int getColumnWidth(int col)
          Gets the column width for the specified column
 DataValidation getDataValidation()
          Gets the data validations.
 Image getDrawing(int i)
          Accessor for the image
 DrawingData getDrawingData()
          Used by one of the demo programs for debugging purposes only
 DrawingGroupObject[] getDrawings()
          Gets the drawings.
 Hyperlink[] getHyperlinks()
          Gets the hyperlinks on this sheet
 Range[] getMergedCells()
          Gets the cells which have been merged on this sheet
 java.lang.String getName()
          Gets the name of this sheet
 int getNumberOfImages()
          Accessor for the number of images on the sheet
 PLSRecord getPLS()
          Accessor for the environment specific print record, invoked when copying sheets
 Cell[] getRow(int row)
          Gets all the cells on the specified row.
 int getRowHeight(int row)
          Deprecated. use getRowView instead
 int[] getRowPageBreaks()
          Gets the row breaks.
 RowRecord[] getRowProperties()
          Gets the non-default rows.
 int getRows()
          Returns the number of rows in this sheet
 CellView getRowView(int row)
          Gets the row view for the specified row
 SheetSettings getSettings()
          Accessor for the sheet settings
 BOFRecord getSheetBof()
          Used when copying sheets in order to determine the type of this sheet
 BOFRecord getWorkbookBof()
          Used when copying sheets in order to determine the type of the containing workboook
 WorkspaceInformationRecord getWorkspaceOptions()
          Gets the workspace options for this sheet.
 boolean isHidden()
          Deprecated. in favour of the getSettings function
 boolean isProtected()
          Deprecated. in favour of the getSettings() api
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCell

public Cell getCell(java.lang.String loc)
Returns the cell for the specified location eg. "A4", using the CellReferenceHelper

Specified by:
getCell in interface Sheet
Parameters:
loc - the cell reference
Returns:
the cell at the specified co-ordinates

getCell

public Cell getCell(int column,
                    int row)
Returns the cell specified at this row and at this column

Specified by:
getCell in interface Sheet
Parameters:
row - the row number
column - the column number
Returns:
the cell at the specified co-ordinates

findCell

public 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

Specified by:
findCell in interface Sheet
Parameters:
contents - the string to match
Returns:
the Cell whose contents match the paramter, null if not found

findLabelCell

public 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 methods in that only cells with labels are queried - all numerical cells are ignored. This should therefore improve performance.

Specified by:
findLabelCell in interface Sheet
Parameters:
contents - the string to match
Returns:
the Cell whose contents match the paramter, null if not found

getRows

public int getRows()
Returns the number of rows in this sheet

Specified by:
getRows in interface Sheet
Returns:
the number of rows in this sheet

getColumns

public int getColumns()
Returns the number of columns in this sheet

Specified by:
getColumns in interface Sheet
Returns:
the number of columns in this sheet

getRow

public Cell[] getRow(int row)
Gets all the cells on the specified row. The returned array will be stripped of all trailing empty cells

Specified by:
getRow in interface Sheet
Parameters:
row - the rows whose cells are to be returned
Returns:
the cells on the given row

getColumn

public Cell[] getColumn(int col)
Gets all the cells on the specified column. The returned array will be stripped of all trailing empty cells

Specified by:
getColumn in interface Sheet
Parameters:
col - the column whose cells are to be returned
Returns:
the cells on the specified column

getName

public java.lang.String getName()
Gets the name of this sheet

Specified by:
getName in interface Sheet
Returns:
the name of the sheet

isHidden

public boolean isHidden()
Deprecated. in favour of the getSettings function

Determines whether the sheet is hidden

Specified by:
isHidden in interface Sheet
Returns:
whether or not the sheet is hidden

getColumnInfo

public ColumnInfoRecord getColumnInfo(int col)
Gets the column info record for the specified column. If no column is specified, null is returned

Parameters:
col - the column
Returns:
the ColumnInfoRecord if specified, NULL otherwise

getColumnInfos

public ColumnInfoRecord[] getColumnInfos()
Gets all the column info records

Returns:
the ColumnInfoRecordArray

getHyperlinks

public Hyperlink[] getHyperlinks()
Gets the hyperlinks on this sheet

Specified by:
getHyperlinks in interface Sheet
Returns:
an array of hyperlinks

getMergedCells

public Range[] getMergedCells()
Gets the cells which have been merged on this sheet

Specified by:
getMergedCells in interface Sheet
Returns:
an array of range objects

getRowProperties

public RowRecord[] getRowProperties()
Gets the non-default rows. Used when copying spreadsheets

Returns:
an array of row properties

getDataValidation

public DataValidation getDataValidation()
Gets the data validations. Used when copying sheets

Returns:
the data validations

getRowPageBreaks

public final int[] getRowPageBreaks()
Gets the row breaks. Called when copying sheets

Specified by:
getRowPageBreaks in interface Sheet
Returns:
the explicit row breaks

getCharts

public final Chart[] getCharts()
Gets the charts. Called when copying sheets

Returns:
the charts on this page

getDrawings

public final DrawingGroupObject[] getDrawings()
Gets the drawings. Called when copying sheets

Returns:
the drawings on this page

isProtected

public boolean isProtected()
Deprecated. in favour of the getSettings() api

Determines whether the sheet is protected

Specified by:
isProtected in interface Sheet
Returns:
whether or not the sheet is protected

getWorkspaceOptions

public WorkspaceInformationRecord getWorkspaceOptions()
Gets the workspace options for this sheet. Called during the copy process

Returns:
the workspace options

getSettings

public SheetSettings getSettings()
Accessor for the sheet settings

Specified by:
getSettings in interface Sheet
Returns:
the settings for this sheet

getColumnFormat

public CellFormat getColumnFormat(int col)
Deprecated. use getColumnView instead

Gets the column format for the specified column

Specified by:
getColumnFormat in interface Sheet
Parameters:
col - the column number
Returns:
the column format, or NULL if the column has no specific format

getColumnWidth

public int getColumnWidth(int col)
Gets the column width for the specified column

Specified by:
getColumnWidth in interface Sheet
Parameters:
col - the column number
Returns:
the column width, or the default width if the column has no specified format

getColumnView

public CellView getColumnView(int col)
Gets the column width for the specified column

Specified by:
getColumnView in interface Sheet
Parameters:
col - the column number
Returns:
the column format, or the default format if no override is specified

getRowHeight

public int getRowHeight(int row)
Deprecated. use getRowView instead

Gets the row height for the specified column

Specified by:
getRowHeight in interface Sheet
Parameters:
row - the row number
Returns:
the row height, or the default height if the row has no specified format

getRowView

public CellView getRowView(int row)
Gets the row view for the specified row

Specified by:
getRowView in interface Sheet
Parameters:
row - the row number
Returns:
the row format, or the default format if no override is specified

getSheetBof

public BOFRecord getSheetBof()
Used when copying sheets in order to determine the type of this sheet

Returns:
the BOF Record

getWorkbookBof

public BOFRecord getWorkbookBof()
Used when copying sheets in order to determine the type of the containing workboook

Returns:
the workbook BOF Record

getPLS

public PLSRecord getPLS()
Accessor for the environment specific print record, invoked when copying sheets

Returns:
the environment specific print record

getButtonPropertySet

public ButtonPropertySetRecord getButtonPropertySet()
Accessor for the button property set, used during copying

Returns:
the button property set

getNumberOfImages

public int getNumberOfImages()
Accessor for the number of images on the sheet

Specified by:
getNumberOfImages in interface Sheet
Returns:
the number of images on this sheet

getDrawing

public Image getDrawing(int i)
Accessor for the image

Specified by:
getDrawing in interface Sheet
Parameters:
i - the 0 based image number
Returns:
the image at the specified position

getDrawingData

public DrawingData getDrawingData()
Used by one of the demo programs for debugging purposes only