OpenOffice.org
XMerge API

org.openoffice.xmerge.converter.xml.sxc
Class SpreadsheetEncoder

java.lang.Object
  |
  +--org.openoffice.xmerge.converter.xml.sxc.SpreadsheetEncoder

public abstract class SpreadsheetEncoder
extends java.lang.Object

This class is a abstract class for encoding an SXC into an alternative spreadsheet format.

TODO - Add appropriate exceptions to each of the methods.


Constructor Summary
SpreadsheetEncoder(java.lang.String name, java.lang.String password)
          Creates new SpreadsheetEncoder.
 
Method Summary
abstract  void addCell(int row, int column, Format fmt, java.lang.String cellContents)
          Add a cell to the current WorkSheet.
abstract  void createWorksheet(java.lang.String sheetName)
          Create a new WorkSheet within the WorkBook.
abstract  int getNumberOfSheets()
          Get the number of sheets in the WorkBook.
abstract  java.lang.String getSheetName(int sheet)
          Get the names of the sheets in the WorkBook.
abstract  void setCellFormat(int row, int column, Format fmt)
          Set a cell's formatting options via a separately create Format object.
abstract  void setColumnWidths(IntArrayList columnWidths)
          Set the width of the columns in the WorkBook.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpreadsheetEncoder

public SpreadsheetEncoder(java.lang.String name,
                          java.lang.String password)
                   throws java.io.IOException
Creates new SpreadsheetEncoder.
Parameters:
name - The name of the WorkBook to be created.
password - An optional password for the WorkBook.
Throws:
java.io.IOException - If any I/O error occurs.
Method Detail

addCell

public abstract void addCell(int row,
                             int column,
                             Format fmt,
                             java.lang.String cellContents)
                      throws java.io.IOException
Add a cell to the current WorkSheet.
Parameters:
row - The row number of the cell
column - The column number of the cell
fmt - The Format object describing the appearance of this cell.
cellContents - The text or formula of the cell's contents.

createWorksheet

public abstract void createWorksheet(java.lang.String sheetName)
                              throws java.io.IOException
Create a new WorkSheet within the WorkBook.
Parameters:
sheetName - The name of the WorkSheet.
Throws:
java.io.IOException - If any I/O error occurs.

getNumberOfSheets

public abstract int getNumberOfSheets()
Get the number of sheets in the WorkBook.
Returns:
The number of sheets in the WorkBook.

getSheetName

public abstract java.lang.String getSheetName(int sheet)
Get the names of the sheets in the WorkBook.
Parameters:
sheet - The required sheet.

setCellFormat

public abstract void setCellFormat(int row,
                                   int column,
                                   Format fmt)
Set a cell's formatting options via a separately create Format object.
Parameters:
row - The row number of the cell to be changed
column - The column number of the cell to be changed
fmt - Object containing formatting settings for this cell.

setColumnWidths

public abstract void setColumnWidths(IntArrayList columnWidths)
                              throws java.io.IOException
Set the width of the columns in the WorkBook.
Parameters:
columnWidths - An IntArrayList of column widths.

OpenOffice.org
XMerge API

Copyright © 2002 OpenOffice.org