OpenOffice.org
XMerge API

org.openoffice.xmerge.converter.palm
Class Record

java.lang.Object
  |
  +--org.openoffice.xmerge.converter.palm.Record

public final class Record
extends java.lang.Object

Contains the raw bytes for a Record in a PDB.

Note that it is not associated with a Record number or ID.

See Also:
PalmDocument, PalmDB

Constructor Summary
Record()
          Default constructor.
Record(byte[] d)
          Constructor to create a Record filled with bytes.
Record(byte[] d, byte attrs)
          Constructor to create a Record filled with bytes and assign Record attributes.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Override equals method of Object.
 byte getAttributes()
          This method returns the Record attributes.
 byte[] getBytes()
          This method returns the contents of this Object.
 int getSize()
          This method returns the number of bytes in this object.
 void read(java.io.InputStream ins)
          Read the necessary data to create a PDB from the InputStream.
 void write(java.io.OutputStream outs)
          Write out the Record attributes and Record length followed by the data in this Record object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Record

public Record()
Default constructor.

Record

public Record(byte[] d)

Constructor to create a Record filled with bytes.

Note that this does not check for 64k Record sizes. User of this class must check for that.

Parameters:
d - byte array contents for this object.

Record

public Record(byte[] d,
              byte attrs)

Constructor to create a Record filled with bytes and assign Record attributes.

Note that this does not check for 64k Record sizes. User of this class must check for that.

Parameters:
d - byte array contents for this object.
attrs - Record attributes.
Method Detail

equals

public boolean equals(java.lang.Object obj)

Override equals method of Object.

Two Record objects are equal if they contain the same bytes in the array and the same attributes.

This is used primarily for testing purposes only for now.

Overrides:
equals in class java.lang.Object
Parameters:
obj - A Record object to compare with
Returns:
true if obj is equal, otherwise false.

getAttributes

public byte getAttributes()

This method returns the Record attributes.

  Record attributes consists of (from high to low bit)

  delete (1) - dirty (1) - busy (1) - secret (1) - category (4)
  
Returns:
Record attribute.

getBytes

public byte[] getBytes()
This method returns the contents of this Object.
Returns:
Contents in byte array

getSize

public int getSize()
This method returns the number of bytes in this object.
Returns:
Number of bytes in this object.

read

public void read(java.io.InputStream ins)
          throws java.io.IOException
Read the necessary data to create a PDB from the InputStream.
Parameters:
in - The InputStream to read data from in order to restore the object.
Throws:
java.io.IOException - If any I/O error occurs.

write

public void write(java.io.OutputStream outs)
           throws java.io.IOException
Write out the Record attributes and Record length followed by the data in this Record object.
Parameters:
out - The OutputStream to write the object.
Throws:
java.io.IOException - If any I/O error occurs.

OpenOffice.org
XMerge API

Copyright © 2002 OpenOffice.org