net.sourceforge.jpalm.mobiledb
Class MobileDB

java.lang.Object
  extended by net.sourceforge.jpalm.mobiledb.MobileDB
All Implemented Interfaces:
PalmDB

public class MobileDB
extends java.lang.Object
implements PalmDB

A MobileDB database.


Field Summary
protected  DatabaseInfo databaseInfo
           
protected  java.util.List<DataRecord> dataRecords
           
protected  FieldDefinitionsRecord fieldDefinitionsRecord
           
protected  FieldDisplaySizesRecord fieldDisplaySizesRecord
           
protected  FieldLabelsRecord fieldLabelsRecord
           
protected  java.util.List<FilteredDataRecord> filteredDataRecords
           
protected  Header header
           
protected  PreferencesRecord preferencesRecord
           
protected  SortInfo sortInfo
           
 
Constructor Summary
MobileDB()
          Creates a new MobileDB database with sane defaults, no records, and no fields.
MobileDB(java.util.Map<java.lang.String,Definition> fields)
          Creates a new MobileDB database with sane defaults and no records.
 
Method Summary
 ApplicationInfo getApplicationInfo()
          Needed for PalmDB interface; don't use this unless you know what you are doing.
 java.util.Date getCreationDate()
          Gets the creation date.
 DatabaseInfo getDatabaseInfo()
          Gets the database info block.
 java.util.List<DataRecord> getDataRecords()
          Gets the data records.
 java.util.List<Definition> getFieldDefinitions()
          Gets the field definitions.
 FieldDefinitionsRecord getFieldDefinitionsRecord()
          Gets the field definitions record.
 java.util.List<java.lang.Integer> getFieldDisplaySizes()
          Gets the field display sizes.
 FieldDisplaySizesRecord getFieldDisplaySizesRecord()
          Gets the field display sizes record.
 java.util.List<java.lang.String> getFieldLabels()
          Gets the field labels.
 FieldLabelsRecord getFieldLabelsRecord()
          Gets the field labels record.
 java.util.List<FilteredDataRecord> getFilteredDataRecords()
          Gets the filtered data records.
 Header getHeader()
          Needed for PalmDB interface; don't use this unless you know what you are doing.
 java.util.Date getModificationDate()
          Gets the modification date.
 java.lang.String getName()
          Gets the name of this database.
 java.lang.String getNote()
          Sets the database info note.
 PreferencesRecord getPreferencesRecord()
          Gets the preferences record.
 java.util.List<Record> getRecords()
          Needed for PalmDB interface; don't use this unless you know what you are doing.
 SortInfo getSortInfo()
          Needed for PalmDB interface; don't use this unless you know what you are doing.
 java.lang.Object getUserData()
          Gets the user data.
 byte[] getUserDataAsByteArray()
          Gets the user data.
 void setApplicationInfo(ApplicationInfo applicationInfo)
          Needed for PalmDB interface; don't use this unless you know what you are doing.
 void setCreationDate(java.util.Date date)
          Sets the creation date.
 void setDatabaseInfo(DatabaseInfo databaseInfo)
          Sets the database info block.
 void setDataRecords(java.util.List<DataRecord> dataRecords)
          Sets the data records.
 void setFieldDefinitions(java.util.List<Definition> definitions)
          Sets the field definitions
 void setFieldDefinitionsRecord(FieldDefinitionsRecord fieldDefinitionsRecord)
          Sets the field definitions record.
 void setFieldDisplaySizes(java.util.List<java.lang.Integer> sizes)
          Sets the field display sizes.
 void setFieldDisplaySizesRecord(FieldDisplaySizesRecord fieldDisplaySizesRecord)
          Sets the field display sizes record.
 void setFieldLabels(java.util.List<java.lang.String> fieldLabels)
          Sets the field labels.
 void setFieldLabelsRecord(FieldLabelsRecord fieldLabelsRecord)
          Sets the field labels record.
 void setFilteredDataRecords(java.util.List<FilteredDataRecord> filteredDataRecords)
          Sets the filtered data records.
 void setHeader(Header header)
          Needed for PalmDB interface; don't use this unless you know what you are doing.
 void setModificationDate(java.util.Date date)
          Sets the modification date.
 void setName(java.lang.String name)
          Sets the name of this database.
 void setNote(java.lang.String note)
          Gets the database info note.
 void setPreferencesRecord(PreferencesRecord preferencesRecord)
          Sets the preferences record.
 void setRecords(java.util.List<Record> records)
          Needed for PalmDB interface; don't use this unless you know what you are doing.
 void setSortInfo(SortInfo sortInfo)
          Needed for PalmDB interface; don't use this unless you know what you are doing.
 void setUserData(java.io.Serializable object)
          Sets the user data.
 void setUserDataAsByteArray(byte[] data)
          Sets the user data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

header

protected Header header

sortInfo

protected SortInfo sortInfo

databaseInfo

protected DatabaseInfo databaseInfo

dataRecords

protected java.util.List<DataRecord> dataRecords

filteredDataRecords

protected java.util.List<FilteredDataRecord> filteredDataRecords

fieldDefinitionsRecord

protected FieldDefinitionsRecord fieldDefinitionsRecord

fieldLabelsRecord

protected FieldLabelsRecord fieldLabelsRecord

fieldDisplaySizesRecord

protected FieldDisplaySizesRecord fieldDisplaySizesRecord

preferencesRecord

protected PreferencesRecord preferencesRecord
Constructor Detail

MobileDB

public MobileDB(java.util.Map<java.lang.String,Definition> fields)
Creates a new MobileDB database with sane defaults and no records.


MobileDB

public MobileDB()
Creates a new MobileDB database with sane defaults, no records, and no fields.

Method Detail

getDatabaseInfo

public DatabaseInfo getDatabaseInfo()
Gets the database info block.

Returns:
the database info block

setDatabaseInfo

public void setDatabaseInfo(DatabaseInfo databaseInfo)
Sets the database info block.

Parameters:
databaseInfo - the database info block

getCreationDate

public java.util.Date getCreationDate()
Gets the creation date.

Returns:
the creation date
See Also:
Header.getCreationDate()

setCreationDate

public void setCreationDate(java.util.Date date)
Sets the creation date.

Parameters:
date - the creation date
See Also:
Header.setCreationDate(net.sourceforge.jpalm.palmdb.Date)

getModificationDate

public java.util.Date getModificationDate()
Gets the modification date.

Returns:
the modification date
See Also:
Header.getModificationDate()

setModificationDate

public void setModificationDate(java.util.Date date)
Sets the modification date.

Parameters:
date - the modification date
See Also:
Header.setModificationDate(net.sourceforge.jpalm.palmdb.Date)

getName

public java.lang.String getName()
Gets the name of this database.

Returns:
the name
See Also:
Header.getName()

setName

public void setName(java.lang.String name)
Sets the name of this database.

Parameters:
name - the name
See Also:
Header.setName(String)

getDataRecords

public java.util.List<DataRecord> getDataRecords()
Gets the data records.

Returns:
the data records

setDataRecords

public void setDataRecords(java.util.List<DataRecord> dataRecords)
Sets the data records.

Parameters:
dataRecords - the data records

getFieldDefinitionsRecord

public FieldDefinitionsRecord getFieldDefinitionsRecord()
Gets the field definitions record.

Returns:
the field definitions record

setFieldDefinitionsRecord

public void setFieldDefinitionsRecord(FieldDefinitionsRecord fieldDefinitionsRecord)
Sets the field definitions record.

Parameters:
fieldDefinitionsRecord - the field definitions record

getFieldDefinitions

public java.util.List<Definition> getFieldDefinitions()
Gets the field definitions.

Returns:
the field definitions

setFieldDefinitions

public void setFieldDefinitions(java.util.List<Definition> definitions)
Sets the field definitions

Parameters:
definitions - the field definitions

getFieldDisplaySizesRecord

public FieldDisplaySizesRecord getFieldDisplaySizesRecord()
Gets the field display sizes record.

Returns:
the field display sizes record

setFieldDisplaySizesRecord

public void setFieldDisplaySizesRecord(FieldDisplaySizesRecord fieldDisplaySizesRecord)
Sets the field display sizes record.

Parameters:
fieldDisplaySizesRecord - the field display sizes record

getFieldDisplaySizes

public java.util.List<java.lang.Integer> getFieldDisplaySizes()
Gets the field display sizes.

Returns:
the field display sizes

setFieldDisplaySizes

public void setFieldDisplaySizes(java.util.List<java.lang.Integer> sizes)
Sets the field display sizes.

Parameters:
sizes - the field display sizes

getFieldLabelsRecord

public FieldLabelsRecord getFieldLabelsRecord()
Gets the field labels record.

Returns:
the field labels record

setFieldLabelsRecord

public void setFieldLabelsRecord(FieldLabelsRecord fieldLabelsRecord)
Sets the field labels record.

Parameters:
fieldLabelsRecord - the field labels record

getFieldLabels

public java.util.List<java.lang.String> getFieldLabels()
Gets the field labels.

Returns:
the field labels

setFieldLabels

public void setFieldLabels(java.util.List<java.lang.String> fieldLabels)
Sets the field labels.

Parameters:
fieldLabels - the field labels

getFilteredDataRecords

public java.util.List<FilteredDataRecord> getFilteredDataRecords()
Gets the filtered data records.

Returns:
the filtered data records

setFilteredDataRecords

public void setFilteredDataRecords(java.util.List<FilteredDataRecord> filteredDataRecords)
Sets the filtered data records.

Parameters:
filteredDataRecords - the filtered data records

getPreferencesRecord

public PreferencesRecord getPreferencesRecord()
Gets the preferences record.

Returns:
the preferences record

setPreferencesRecord

public void setPreferencesRecord(PreferencesRecord preferencesRecord)
Sets the preferences record.

Parameters:
preferencesRecord - the preferences record

getNote

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

Returns:
the note

setNote

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

Parameters:
note - the note

setUserData

public void setUserData(java.io.Serializable object)
                 throws java.io.IOException
Sets the user data. The object will be serialized and stored in the sort info block which is unused by MobileDB.

Parameters:
object - the object to embed in the database
Throws:
java.io.IOException - if an error occurs during serialization
See Also:
SortInfo, PalmDB.setSortInfo(SortInfo)

getUserData

public java.lang.Object getUserData()
                             throws java.io.IOException,
                                    java.lang.ClassNotFoundException
Gets the user data. The object will be deserialized from data stored in the sort info block.

Returns:
the object embedded in the database
Throws:
java.io.IOException - if an error occurs during deserialization
java.lang.ClassNotFoundException - if the class of the serialized object cannot be found

setUserDataAsByteArray

public void setUserDataAsByteArray(byte[] data)
Sets the user data. The data will be stored in the sort info block which is unused by MobileDB.

Parameters:
data - the data to embed
See Also:
SortInfo, PalmDB.setSortInfo(SortInfo)

getUserDataAsByteArray

public byte[] getUserDataAsByteArray()
Gets the user data. The data will be loaded from the sort info block.

Returns:
the embedded data

getRecords

public java.util.List<Record> getRecords()
Needed for PalmDB interface; don't use this unless you know what you are doing.

Gets the records.

Specified by:
getRecords in interface PalmDB
Returns:
the records

setRecords

public void setRecords(java.util.List<Record> records)
Needed for PalmDB interface; don't use this unless you know what you are doing.

Sets the records.

Specified by:
setRecords in interface PalmDB
Parameters:
records - the records

getHeader

public Header getHeader()
Needed for PalmDB interface; don't use this unless you know what you are doing.

Gets the header.

Specified by:
getHeader in interface PalmDB
Returns:
the header

setHeader

public void setHeader(Header header)
Needed for PalmDB interface; don't use this unless you know what you are doing.

Sets the header.

Specified by:
setHeader in interface PalmDB
Parameters:
header - the header

getApplicationInfo

public ApplicationInfo getApplicationInfo()
Needed for PalmDB interface; don't use this unless you know what you are doing.

Gets the application info block.

Specified by:
getApplicationInfo in interface PalmDB
Returns:
the application info block

setApplicationInfo

public void setApplicationInfo(ApplicationInfo applicationInfo)
Needed for PalmDB interface; don't use this unless you know what you are doing.

Sets the application info block.

Specified by:
setApplicationInfo in interface PalmDB
Parameters:
applicationInfo - the application info block

getSortInfo

public SortInfo getSortInfo()
Needed for PalmDB interface; don't use this unless you know what you are doing.

Gets the sort info block.

Specified by:
getSortInfo in interface PalmDB
Returns:
the sort info block

setSortInfo

public void setSortInfo(SortInfo sortInfo)
Needed for PalmDB interface; don't use this unless you know what you are doing.

Sets the sort info block.

Specified by:
setSortInfo in interface PalmDB
Parameters:
sortInfo - the sort info block