OpenOffice.org
XMerge API

org.openoffice.xmerge.converter.palm
Class PalmDocument

java.lang.Object
  |
  +--org.openoffice.xmerge.converter.palm.PalmDocument
All Implemented Interfaces:
Document

public class PalmDocument
extends java.lang.Object
implements Document

A PalmDocument is palm implementaion of the Docuemnt interface.

This implementation allows the Palm device format to be read via an InputStream and written via an OutputStream.


Constructor Summary
PalmDocument(java.io.InputStream is)
          Constructor to create a PalmDocument from an InputStream.
PalmDocument(java.lang.String name, int creatorID, int typeID, int version, short attribute, Record[] recs)
          Constructor to create a PalmDocument with Record objects.
 
Method Summary
 java.lang.String getFileName()
          Returns the name of the file.
 java.lang.String getName()
          Returns the Document name.
 PalmDB getPdb()
          Returns the PalmDB contained in this object.
 void read(java.io.InputStream is)
          Reads in a file from the InputStream.
 void setPdb(PalmDB pdb)
          Sets the PalmDocument to a new PalmDB value.
 void write(java.io.OutputStream os)
          Writes the PalmDocument to an OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PalmDocument

public PalmDocument(java.io.InputStream is)
             throws java.io.IOException
Constructor to create a PalmDocument from an InputStream.
Parameters:
is - InputStream containing a PDB.
Throws:
java.io.IOException - If any I/O error occurs.

PalmDocument

public PalmDocument(java.lang.String name,
                    int creatorID,
                    int typeID,
                    int version,
                    short attribute,
                    Record[] recs)
             throws java.io.UnsupportedEncodingException
Constructor to create a PalmDocument with Record objects. recs.length can be zero for an empty PDB.
Parameters:
name - Suggested PDB name in String.
creatorID - The PDB Creator ID.
typeID - The PDB Type ID.
version - The PDB header version.
attribute - The PDB header attribute.
recs - Array of Record objects.
Throws:
NullPointerException - If recs is null.
Method Detail

getFileName

public java.lang.String getFileName()
Returns the name of the file.
Specified by:
getFileName in interface Document
Returns:
The name of the file represented in the PalmDocument.

getName

public java.lang.String getName()
Returns the Document name.
Specified by:
getName in interface Document
Returns:
The Document name.

getPdb

public PalmDB getPdb()
Returns the PalmDB contained in this object.
Returns:
The PalmDB.

read

public void read(java.io.InputStream is)
          throws java.io.IOException
Reads in a file from the InputStream.
Specified by:
read in interface Document
Parameters:
is - InputStream to read in its content.
Throws:
java.io.IOException - If any I/O error occurs.

setPdb

public void setPdb(PalmDB pdb)
Sets the PalmDocument to a new PalmDB value.
Parameters:
pdb - The new PalmDB value.

write

public void write(java.io.OutputStream os)
           throws java.io.IOException
Writes the PalmDocument to an OutputStream.
Specified by:
write in interface Document
Parameters:
is - The OutputStream to write the content.
Throws:
java.io.IOException - If any I/O error occurs.

OpenOffice.org
XMerge API

Copyright © 2002 OpenOffice.org