OpenOffice.org
XMerge API

org.openoffice.xmerge.converter.xml.sxc.pexcel
Class PxlDocument

java.lang.Object
  |
  +--org.openoffice.xmerge.converter.xml.sxc.pexcel.PxlDocument
All Implemented Interfaces:
Document

public class PxlDocument
extends java.lang.Object
implements Document


Constructor Summary
PxlDocument(java.lang.String name)
          Constructs a pocket Excel Document with the name of the file passed in as an argument.
PxlDocument(java.lang.String name, java.io.InputStream is)
          Constructs a pocket Excel Document from the InputStream and assigns it the document name passed in
 
Method Summary
 void addCell(int row, int column, Format fmt, java.lang.String cellContents)
          Adds a cell to the current worksheet
 void addColInfo(IntArrayList columnWidths)
          Take an IntArrayList and generate a number of ColInfo Records.
 int addExtendedFormat(int ixfnt)
          Adds an ExtendedFormat record which contains a specified font index
 int addFontDescriptor(FontDescription fd)
          Add the specified FontDescripton to the header
 void addWorksheet(java.lang.String name)
          Returns the Document name with file extension.
 java.lang.String getFileName()
          Returns the filename of the pxl document with the file extension
 java.lang.String getName()
          Return the filename of the pxl document without the file extension
 java.util.LinkedList getWorksheet(int index)
          Returns the the worksheet at the specified position
 java.util.Vector getWorksheetNames()
          Returns a Vector containing all the worksheet Names
 void read(java.io.InputStream is)
          Read a Pocket Excel Document from the Inputstream and add the relevant records to the Linked Lists for the worksheets OuputStream
 void write(java.io.OutputStream os)
          Writes the records contained in the header and worksheets to the OuputStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PxlDocument

public PxlDocument(java.lang.String name)
Constructs a pocket Excel Document with the name of the file passed in as an argument. Also fills out a basic header block containing the minimum number of objects that can be created at this time.
Parameters:
name - Name of the Pocket Excel Data file. (excluding the file extension)

PxlDocument

public PxlDocument(java.lang.String name,
                   java.io.InputStream is)
            throws java.io.IOException
Constructs a pocket Excel Document from the InputStream and assigns it the document name passed in
Parameters:
is - InputStream containing a Pocket Excel Data file.
Method Detail

addCell

public void addCell(int row,
                    int column,
                    Format fmt,
                    java.lang.String cellContents)
             throws java.io.IOException
Adds a cell to the current worksheet
Parameters:
row - the row number of the cell
col - the Column number of the cell
fmt - the Format of the cell
cellContents - the cell contents

addColInfo

public void addColInfo(IntArrayList columnWidths)
Take an IntArrayList and generate a number of ColInfo Records. Consecutive columns of the same width can use the same ColInfo
Parameters:
columnWidths - an IntArrayList describing column widths

addExtendedFormat

public int addExtendedFormat(int ixfnt)
Adds an ExtendedFormat record which contains a specified font index
Parameters:
ixfnt - font index the new ExtendedRecord should contain
Returns:
the current number of extended format records

addFontDescriptor

public int addFontDescriptor(FontDescription fd)
Add the specified FontDescripton to the header
Parameters:
fd - the FontDescription that is to be added to the header
Returns:
the index in the header where the FontDescription is added

addWorksheet

public void addWorksheet(java.lang.String name)
                  throws java.io.IOException
Returns the Document name with file extension.
Returns:
The Document name with file extension.

getFileName

public java.lang.String getFileName()
Returns the filename of the pxl document with the file extension
Specified by:
getFileName in interface Document
Returns:
filename with the file extension

getName

public java.lang.String getName()
Return the filename of the pxl document without the file extension
Specified by:
getName in interface Document
Returns:
filename without the file extension

getWorksheet

public java.util.LinkedList getWorksheet(int index)
Returns the the worksheet at the specified position
Parameters:
index - the index of the worksheet to return
Returns:
the LinkedList containing the worksheet

getWorksheetNames

public java.util.Vector getWorksheetNames()
Returns a Vector containing all the worksheet Names
Returns:
a Vector containing all the worksheet Names

read

public void read(java.io.InputStream is)
          throws java.io.IOException
Read a Pocket Excel Document from the Inputstream and add the relevant records to the Linked Lists for the worksheets OuputStream
Specified by:
read in interface Document
Parameters:
is - The Inputstream containing the pxl document

write

public void write(java.io.OutputStream os)
           throws java.io.IOException
Writes the records contained in the header and worksheets to the OuputStream
Specified by:
write in interface Document
Parameters:
os - The Outputstream to write to

OpenOffice.org
XMerge API

Copyright © 2002 OpenOffice.org