net.sourceforge.jpalm.mobiledb.record
Class PreferencesRecord

java.lang.Object
  extended by net.sourceforge.jpalm.DataBlock
      extended by net.sourceforge.jpalm.mobiledb.record.AbstractRecord
          extended by net.sourceforge.jpalm.mobiledb.record.PreferencesRecord
All Implemented Interfaces:
Record

public class PreferencesRecord
extends AbstractRecord

The preferences record in a MobileDB database.

There should always be 20 fields in this record. The first field contains the database info note. The remaining fields are unused.

When this class is serialized, if the field count is not 20, fields will be added or removed until the count is 20. If fields need to be added, they will be empty strings.


Field Summary
static net.sourceforge.juint.UInt8 CATEGORY_ID
          The category identifier for this record.
 
Fields inherited from class net.sourceforge.jpalm.mobiledb.record.AbstractRecord
fields, header, HEADER, MAX_FIELD_WIDTH, TERIMINATOR, TRAILER
 
Constructor Summary
PreferencesRecord()
          Creates a new preferences record.
PreferencesRecord(byte[] data)
          Creates a new preferences record from a byte array.
PreferencesRecord(Record record)
          Creates a new preferences record from a Record.
PreferencesRecord(java.lang.String note)
          Creates a new preferences record from a note.
 
Method Summary
 java.lang.String getNote()
          Gets the database info note.
 byte[] serialize()
          Create a byte array of the class properties.
 void setNote(java.lang.String note)
          Sets the database info note.
 
Methods inherited from class net.sourceforge.jpalm.mobiledb.record.AbstractRecord
deserialize, equals, getHeader, getInternalFields, setHeader, setInternalFields, trimOrFillList
 
Methods inherited from class net.sourceforge.jpalm.DataBlock
toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CATEGORY_ID

public static final net.sourceforge.juint.UInt8 CATEGORY_ID
The category identifier for this record.

Constructor Detail

PreferencesRecord

public PreferencesRecord()
Creates a new preferences record.


PreferencesRecord

public PreferencesRecord(byte[] data)
Creates a new preferences record from a byte array.

Parameters:
data - the byte array
See Also:
AbstractRecord.deserialize(byte[])

PreferencesRecord

public PreferencesRecord(Record record)
Creates a new preferences record from a Record.

Parameters:
record - the record

PreferencesRecord

public PreferencesRecord(java.lang.String note)
Creates a new preferences record from a note.

Parameters:
note - the note
See Also:
setNote(String)
Method Detail

getNote

public java.lang.String getNote()
Gets the database info note.

Returns:
the note or "" if there is not a note set

setNote

public void setNote(java.lang.String note)
Sets the database info note.

Parameters:
note - the note to set

serialize

public byte[] serialize()
Description copied from class: DataBlock
Create a byte array of the class properties.

Specified by:
serialize in interface Record
Overrides:
serialize in class AbstractRecord
Returns:
the byte array