net.sourceforge.jpalm.palmdb
Class Header

java.lang.Object
  extended by net.sourceforge.jpalm.DataBlock
      extended by net.sourceforge.jpalm.palmdb.Header

public class Header
extends DataBlock

The header in a Palm database.


Field Summary
protected  net.sourceforge.juint.UInt32 applicationInfoOffset
           
static net.sourceforge.juint.UInt16 ATTRIBUTE_BACKUP_DATABASE
          Backup database on next HotSync.
static net.sourceforge.juint.UInt16 ATTRIBUTE_BUNDLE
          Database is associated with the application with the same creator.
static net.sourceforge.juint.UInt16 ATTRIBUTE_COPY_PREVENTION
          Disallow copies of this database.
static net.sourceforge.juint.UInt16 ATTRIBUTE_DIRTY_APPLICATION_INFO_AREA
          Database's application info block is dirty.
static net.sourceforge.juint.UInt16 ATTRIBUTE_HIDDEN
          Database should be hidden from view.
static net.sourceforge.juint.UInt16 ATTRIBUTE_LAUNCHABLE_DATA
          This data database can be launched by having it's name passed to it's owning application.
static net.sourceforge.juint.UInt16 ATTRIBUTE_OK_TO_INSTALL_NEWER
          Replace existing database.
static net.sourceforge.juint.UInt16 ATTRIBUTE_OPEN
          Database is open.
static net.sourceforge.juint.UInt16 ATTRIBUTE_READ_ONLY
          Database is read-only.
static net.sourceforge.juint.UInt16 ATTRIBUTE_RECYCLABLE
          Database will be deleted when closed or upon a system reset.
static net.sourceforge.juint.UInt16 ATTRIBUTE_RESET_DEVICE_AFTER_INSTALL
          Reset device after this database is installed.
static net.sourceforge.juint.UInt16 ATTRIBUTE_RESOURCE_DATABASE
          Database is a resource database.
static net.sourceforge.juint.UInt16 ATTRIBUTE_STREAM
          Database is a file stream.
protected  net.sourceforge.juint.UInt16 attributes
           
protected  Date creationDate
           
protected  java.lang.String creator
           
static int CREATOR_LENGTH
          The maximum length of the creator name.
4
static int DATA_LENGTH
          The maximum length of the header in bytes.
78
protected  Date lastBackupDate
           
protected  Date modificationDate
           
protected  net.sourceforge.juint.UInt32 modificationNumber
           
protected  java.lang.String name
           
static int NAME_LENGTH
          The maximum length of the database name, including 1 for the null terminator.
32
protected  net.sourceforge.juint.UInt32 nextRecordListOffset
           
protected  net.sourceforge.juint.UInt16 numberOfRecords
           
protected  net.sourceforge.juint.UInt32 sortInfoOffset
           
protected  java.lang.String type
           
static int TYPE_LENGTH
          The maximum length of the type name.
4
protected  net.sourceforge.juint.UInt32 uniqueIdSeed
           
protected  net.sourceforge.juint.UInt16 version
           
 
Constructor Summary
Header()
          Creates a new header.
Header(byte[] data)
          Creates a new header from the byte array.
 
Method Summary
 void addAttribute(net.sourceforge.juint.UInt16 attribute)
          Adds an attribute.
 void deserialize(byte[] data)
          Populate class properties from a byte array.
 boolean equals(java.lang.Object object)
           
 net.sourceforge.juint.UInt32 getApplicationInfoOffset()
          Gets the offset of the application info block.
 net.sourceforge.juint.UInt16 getAttributes()
          Gets the attributes.
 Date getCreationDate()
          Gets the creation date.
 java.lang.String getCreator()
          Gets the creator.
 Date getLastBackupDate()
          Gets the last backup date.
 Date getModificationDate()
          Gets the modification date.
 net.sourceforge.juint.UInt32 getModificationNumber()
          Gets the modification number.
 java.lang.String getName()
          Gets the name of the Palm database.
 net.sourceforge.juint.UInt32 getNextRecordListOffset()
          Gets the offset of the next record list.
 net.sourceforge.juint.UInt16 getNumberOfRecords()
          Gets the number of records in the Palm database.
 net.sourceforge.juint.UInt32 getSortInfoOffset()
          Gets the offset of the sort info block.
 java.lang.String getType()
          Gets the type.
 net.sourceforge.juint.UInt32 getUniqueIdSeed()
          Gets the unique id seed.
 net.sourceforge.juint.UInt16 getVersion()
          Gets the version.
 void removeAttribute(net.sourceforge.juint.UInt16 attribute)
          Removes an attribute.
 byte[] serialize()
          Create a byte array of the class properties.
 void setApplicationInfoOffset(net.sourceforge.juint.UInt32 applicationInfoOffset)
          Sets the offset of the application info block.
 void setAttributes(net.sourceforge.juint.UInt16 attributes)
          Sets the attributes.
 void setCreationDate(Date creationDate)
          Sets the creation date.
 void setCreator(java.lang.String creator)
          Sets the creator.
 void setLastBackupDate(Date lastBackupDate)
          Sets the last backup date.
 void setModificationDate(Date modificationDate)
          Sets the modification date.
 void setModificationNumber(net.sourceforge.juint.UInt32 modificationNumber)
          Sets the modificaiton number.
 void setName(java.lang.String name)
          Sets the name of the Palm database.
 void setNextRecordListOffset(net.sourceforge.juint.UInt32 nextRecordListOffset)
          Sets the offset of the next record list.
 void setNumberOfRecords(net.sourceforge.juint.UInt16 numberOfRecords)
          Sets the number of records in the Palm database.
 void setSortInfoOffset(net.sourceforge.juint.UInt32 sortInfoOffset)
          Sets the offset of the sort info block.
 void setType(java.lang.String type)
          Sets the type.
 void setUniqueIdSeed(net.sourceforge.juint.UInt32 uniqueIdSeed)
          Sets the unique id seed.
 void setVersion(net.sourceforge.juint.UInt16 version)
          Sets the version.
 
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

NAME_LENGTH

public static final int NAME_LENGTH
The maximum length of the database name, including 1 for the null terminator.
32

See Also:
Constant Field Values

CREATOR_LENGTH

public static final int CREATOR_LENGTH
The maximum length of the creator name.
4

See Also:
Constant Field Values

TYPE_LENGTH

public static final int TYPE_LENGTH
The maximum length of the type name.
4

See Also:
Constant Field Values

DATA_LENGTH

public static final int DATA_LENGTH
The maximum length of the header in bytes.
78

See Also:
Constant Field Values

ATTRIBUTE_RESOURCE_DATABASE

public static final net.sourceforge.juint.UInt16 ATTRIBUTE_RESOURCE_DATABASE
Database is a resource database.


ATTRIBUTE_READ_ONLY

public static final net.sourceforge.juint.UInt16 ATTRIBUTE_READ_ONLY
Database is read-only.


ATTRIBUTE_DIRTY_APPLICATION_INFO_AREA

public static final net.sourceforge.juint.UInt16 ATTRIBUTE_DIRTY_APPLICATION_INFO_AREA
Database's application info block is dirty.


ATTRIBUTE_BACKUP_DATABASE

public static final net.sourceforge.juint.UInt16 ATTRIBUTE_BACKUP_DATABASE
Backup database on next HotSync.


ATTRIBUTE_OK_TO_INSTALL_NEWER

public static final net.sourceforge.juint.UInt16 ATTRIBUTE_OK_TO_INSTALL_NEWER
Replace existing database.


ATTRIBUTE_RESET_DEVICE_AFTER_INSTALL

public static final net.sourceforge.juint.UInt16 ATTRIBUTE_RESET_DEVICE_AFTER_INSTALL
Reset device after this database is installed.


ATTRIBUTE_COPY_PREVENTION

public static final net.sourceforge.juint.UInt16 ATTRIBUTE_COPY_PREVENTION
Disallow copies of this database.


ATTRIBUTE_STREAM

public static final net.sourceforge.juint.UInt16 ATTRIBUTE_STREAM
Database is a file stream.


ATTRIBUTE_HIDDEN

public static final net.sourceforge.juint.UInt16 ATTRIBUTE_HIDDEN
Database should be hidden from view. For data databases this hides the record count. For applications this hides the database from the main launcher view.


ATTRIBUTE_LAUNCHABLE_DATA

public static final net.sourceforge.juint.UInt16 ATTRIBUTE_LAUNCHABLE_DATA
This data database can be launched by having it's name passed to it's owning application.


ATTRIBUTE_RECYCLABLE

public static final net.sourceforge.juint.UInt16 ATTRIBUTE_RECYCLABLE
Database will be deleted when closed or upon a system reset.


ATTRIBUTE_BUNDLE

public static final net.sourceforge.juint.UInt16 ATTRIBUTE_BUNDLE
Database is associated with the application with the same creator. It will be beamed along with the application.


ATTRIBUTE_OPEN

public static final net.sourceforge.juint.UInt16 ATTRIBUTE_OPEN
Database is open.


name

protected java.lang.String name

attributes

protected net.sourceforge.juint.UInt16 attributes

version

protected net.sourceforge.juint.UInt16 version

creationDate

protected Date creationDate

modificationDate

protected Date modificationDate

lastBackupDate

protected Date lastBackupDate

modificationNumber

protected net.sourceforge.juint.UInt32 modificationNumber

applicationInfoOffset

protected net.sourceforge.juint.UInt32 applicationInfoOffset

sortInfoOffset

protected net.sourceforge.juint.UInt32 sortInfoOffset

type

protected java.lang.String type

creator

protected java.lang.String creator

uniqueIdSeed

protected net.sourceforge.juint.UInt32 uniqueIdSeed

nextRecordListOffset

protected net.sourceforge.juint.UInt32 nextRecordListOffset

numberOfRecords

protected net.sourceforge.juint.UInt16 numberOfRecords
Constructor Detail

Header

public Header(byte[] data)
Creates a new header from the byte array.

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

Header

public Header()
Creates a new header.

Method Detail

getApplicationInfoOffset

public net.sourceforge.juint.UInt32 getApplicationInfoOffset()
Gets the offset of the application info block.

Returns:
the offset

setApplicationInfoOffset

public void setApplicationInfoOffset(net.sourceforge.juint.UInt32 applicationInfoOffset)
Sets the offset of the application info block.

Parameters:
applicationInfoOffset - the offset

getAttributes

public net.sourceforge.juint.UInt16 getAttributes()
Gets the attributes.

Returns:
the attributes
See Also:
ATTRIBUTE_BACKUP_DATABASE, ATTRIBUTE_BUNDLE, ATTRIBUTE_COPY_PREVENTION, ATTRIBUTE_DIRTY_APPLICATION_INFO_AREA, ATTRIBUTE_HIDDEN, ATTRIBUTE_LAUNCHABLE_DATA, ATTRIBUTE_OK_TO_INSTALL_NEWER, ATTRIBUTE_OPEN, ATTRIBUTE_READ_ONLY, ATTRIBUTE_RECYCLABLE, ATTRIBUTE_RESET_DEVICE_AFTER_INSTALL, ATTRIBUTE_RESOURCE_DATABASE, ATTRIBUTE_STREAM

setAttributes

public void setAttributes(net.sourceforge.juint.UInt16 attributes)
Sets the attributes.

Parameters:
attributes - the attributes
See Also:
ATTRIBUTE_BACKUP_DATABASE, ATTRIBUTE_BUNDLE, ATTRIBUTE_COPY_PREVENTION, ATTRIBUTE_DIRTY_APPLICATION_INFO_AREA, ATTRIBUTE_HIDDEN, ATTRIBUTE_LAUNCHABLE_DATA, ATTRIBUTE_OK_TO_INSTALL_NEWER, ATTRIBUTE_OPEN, ATTRIBUTE_READ_ONLY, ATTRIBUTE_RECYCLABLE, ATTRIBUTE_RESET_DEVICE_AFTER_INSTALL, ATTRIBUTE_RESOURCE_DATABASE, ATTRIBUTE_STREAM

addAttribute

public void addAttribute(net.sourceforge.juint.UInt16 attribute)
Adds an attribute.

Parameters:
attribute - the attribute
See Also:
ATTRIBUTE_BACKUP_DATABASE, ATTRIBUTE_BUNDLE, ATTRIBUTE_COPY_PREVENTION, ATTRIBUTE_DIRTY_APPLICATION_INFO_AREA, ATTRIBUTE_HIDDEN, ATTRIBUTE_LAUNCHABLE_DATA, ATTRIBUTE_OK_TO_INSTALL_NEWER, ATTRIBUTE_OPEN, ATTRIBUTE_READ_ONLY, ATTRIBUTE_RECYCLABLE, ATTRIBUTE_RESET_DEVICE_AFTER_INSTALL, ATTRIBUTE_RESOURCE_DATABASE, ATTRIBUTE_STREAM

removeAttribute

public void removeAttribute(net.sourceforge.juint.UInt16 attribute)
Removes an attribute.

Parameters:
attribute - the attribute
See Also:
ATTRIBUTE_BACKUP_DATABASE, ATTRIBUTE_BUNDLE, ATTRIBUTE_COPY_PREVENTION, ATTRIBUTE_DIRTY_APPLICATION_INFO_AREA, ATTRIBUTE_HIDDEN, ATTRIBUTE_LAUNCHABLE_DATA, ATTRIBUTE_OK_TO_INSTALL_NEWER, ATTRIBUTE_OPEN, ATTRIBUTE_READ_ONLY, ATTRIBUTE_RECYCLABLE, ATTRIBUTE_RESET_DEVICE_AFTER_INSTALL, ATTRIBUTE_RESOURCE_DATABASE, ATTRIBUTE_STREAM

getCreationDate

public Date getCreationDate()
Gets the creation date.

Returns:
the creation date

setCreationDate

public void setCreationDate(Date creationDate)
Sets the creation date.

Parameters:
creationDate - the creation date

getCreator

public java.lang.String getCreator()
Gets the creator.

Returns:
the creator

setCreator

public void setCreator(java.lang.String creator)
Sets the creator. The creator cannot be longer than CREATOR_LENGTH characters.

Parameters:
creator - the creator

getLastBackupDate

public Date getLastBackupDate()
Gets the last backup date.

Returns:
the last backup date

setLastBackupDate

public void setLastBackupDate(Date lastBackupDate)
Sets the last backup date.

Parameters:
lastBackupDate - the last backup date

getModificationDate

public Date getModificationDate()
Gets the modification date.

Returns:
the modification date

setModificationDate

public void setModificationDate(Date modificationDate)
Sets the modification date.

Parameters:
modificationDate - the modification date

getModificationNumber

public net.sourceforge.juint.UInt32 getModificationNumber()
Gets the modification number.

Returns:
the modification number

setModificationNumber

public void setModificationNumber(net.sourceforge.juint.UInt32 modificationNumber)
Sets the modificaiton number.

Parameters:
modificationNumber - the modification number

getName

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

Returns:
the name

setName

public void setName(java.lang.String name)
Sets the name of the Palm database. The name cannot be longer than 32 characters.

Parameters:
name - the name

getNextRecordListOffset

public net.sourceforge.juint.UInt32 getNextRecordListOffset()
Gets the offset of the next record list. (Not used).

Returns:
the offset

setNextRecordListOffset

public void setNextRecordListOffset(net.sourceforge.juint.UInt32 nextRecordListOffset)
Sets the offset of the next record list. (Not used).

Parameters:
nextRecordListOffset - the offset

getNumberOfRecords

public net.sourceforge.juint.UInt16 getNumberOfRecords()
Gets the number of records in the Palm database.

Returns:
the number of records

setNumberOfRecords

public void setNumberOfRecords(net.sourceforge.juint.UInt16 numberOfRecords)
Sets the number of records in the Palm database.

Parameters:
numberOfRecords - the number of records

getSortInfoOffset

public net.sourceforge.juint.UInt32 getSortInfoOffset()
Gets the offset of the sort info block.

Returns:
the offset

setSortInfoOffset

public void setSortInfoOffset(net.sourceforge.juint.UInt32 sortInfoOffset)
Sets the offset of the sort info block.

Parameters:
sortInfoOffset - the offset

getType

public java.lang.String getType()
Gets the type.

Returns:
the type

setType

public void setType(java.lang.String type)
Sets the type. The type cannot be longer than 4 characters.

Parameters:
type - the type

getUniqueIdSeed

public net.sourceforge.juint.UInt32 getUniqueIdSeed()
Gets the unique id seed.

Returns:
the unique id seed

setUniqueIdSeed

public void setUniqueIdSeed(net.sourceforge.juint.UInt32 uniqueIdSeed)
Sets the unique id seed.

Parameters:
uniqueIdSeed - the unique id seed

getVersion

public net.sourceforge.juint.UInt16 getVersion()
Gets the version. The version is for use by the user and is not used by the Palm.

Returns:
the version

setVersion

public void setVersion(net.sourceforge.juint.UInt16 version)
Sets the version. The version is for use by the user and is not used by the Palm.

Parameters:
version - the version

deserialize

public void deserialize(byte[] data)
Description copied from class: DataBlock
Populate class properties from a byte array.

Specified by:
deserialize in class DataBlock
Parameters:
data - the byte array

serialize

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

Specified by:
serialize in class DataBlock
Returns:
the byte array

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class DataBlock