net.sourceforge.jpalm.palmdb
Class RecordHeader

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

public class RecordHeader
extends DataBlock

A record header in a Palm database.

See Also:
PalmDB, Record

Field Summary
protected  net.sourceforge.juint.UInt8 attributes
           
static net.sourceforge.juint.UInt8 CATEGORY_ATTRIBUTES
          The bits for category attributes.
static int DATA_LENGTH
          The length of this DataBlock in bytes.
8
protected  net.sourceforge.juint.UInt32 offset
           
static net.sourceforge.juint.UInt8 RECORD_ATTRIBUTES
          The bits for record attributes.
static net.sourceforge.juint.UInt8 RECORD_BUSY
          Record is busy (locked).
static net.sourceforge.juint.UInt8 RECORD_DELETE
          Record is deleted.
static net.sourceforge.juint.UInt8 RECORD_DIRTY
          Record is dirty (modified since last HotSync).
static net.sourceforge.juint.UInt8 RECORD_SECRET
          Record is private.
protected  net.sourceforge.juint.UInt32 uniqueId
           
 
Constructor Summary
RecordHeader()
          Creates a new record header.
RecordHeader(byte[] data)
          Creates a new record header from the byte array.
 
Method Summary
 void addAttribute(net.sourceforge.juint.UInt8 attribute)
          Adds an attribute.
 void deserialize(byte[] data)
          Populate class properties from a byte array.
 boolean equals(java.lang.Object object)
           
 net.sourceforge.juint.UInt8 getAttributes()
          Gets the attributes for the record this header represents.
 net.sourceforge.juint.UInt8 getCategory()
          Gets the category identifier for the record this header represents.
 net.sourceforge.juint.UInt32 getOffset()
          Gets the offset of the record this header represents.
 net.sourceforge.juint.UInt32 getUniqueId()
          Gets the unique identifier of the record this header represents.
 void removeAttribute(net.sourceforge.juint.UInt8 attribute)
          Removes an attribute.
 byte[] serialize()
          Create a byte array of the class properties.
 void setAttributes(net.sourceforge.juint.UInt8 attributes)
          Sets the attributes for the record this header represents.
 void setCategory(net.sourceforge.juint.UInt8 category)
          Sets the category identifier for the record this header represents.
 void setOffset(net.sourceforge.juint.UInt32 offset)
          Sets the offset of the record this header represents.
 void setUniqueId(net.sourceforge.juint.UInt32 uniqueId)
          Sets the unique identifier of the record this header represents.
 
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

DATA_LENGTH

public static final int DATA_LENGTH
The length of this DataBlock in bytes.
8

See Also:
Constant Field Values

CATEGORY_ATTRIBUTES

public static final net.sourceforge.juint.UInt8 CATEGORY_ATTRIBUTES
The bits for category attributes.


RECORD_ATTRIBUTES

public static final net.sourceforge.juint.UInt8 RECORD_ATTRIBUTES
The bits for record attributes.


RECORD_SECRET

public static final net.sourceforge.juint.UInt8 RECORD_SECRET
Record is private.


RECORD_BUSY

public static final net.sourceforge.juint.UInt8 RECORD_BUSY
Record is busy (locked).


RECORD_DIRTY

public static final net.sourceforge.juint.UInt8 RECORD_DIRTY
Record is dirty (modified since last HotSync).


RECORD_DELETE

public static final net.sourceforge.juint.UInt8 RECORD_DELETE
Record is deleted.


offset

protected net.sourceforge.juint.UInt32 offset

attributes

protected net.sourceforge.juint.UInt8 attributes

uniqueId

protected net.sourceforge.juint.UInt32 uniqueId
Constructor Detail

RecordHeader

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

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

RecordHeader

public RecordHeader()
Creates a new record header.

Method Detail

getAttributes

public net.sourceforge.juint.UInt8 getAttributes()
Gets the attributes for the record this header represents. The attribute field contains record and category information.

Returns:
the attributes
See Also:
CATEGORY_ATTRIBUTES, RECORD_ATTRIBUTES, RECORD_BUSY, RECORD_DELETE, RECORD_DIRTY, RECORD_SECRET

setAttributes

public void setAttributes(net.sourceforge.juint.UInt8 attributes)
Sets the attributes for the record this header represents. The attribute field contains record and category information.

Parameters:
attributes - the attributes
See Also:
CATEGORY_ATTRIBUTES, RECORD_ATTRIBUTES, RECORD_BUSY, RECORD_DELETE, RECORD_DIRTY, RECORD_SECRET

addAttribute

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

Parameters:
attribute - the attribute
See Also:
RECORD_BUSY, RECORD_DELETE, RECORD_DIRTY, RECORD_SECRET

removeAttribute

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

Parameters:
attribute - the attribute
See Also:
RECORD_BUSY, RECORD_DELETE, RECORD_DIRTY, RECORD_SECRET

getCategory

public net.sourceforge.juint.UInt8 getCategory()
Gets the category identifier for the record this header represents. The category identifier can be used to lookup the category label.

Returns:
the category identifier
See Also:
CATEGORY_ATTRIBUTES, getAttributes(), ApplicationInfo.getCategoryUniqueIds(), ApplicationInfo.getCategoryLabels(), Category

setCategory

public void setCategory(net.sourceforge.juint.UInt8 category)
Sets the category identifier for the record this header represents.

Parameters:
category - the category identifier
See Also:
CATEGORY_ATTRIBUTES, setAttributes(UInt8), ApplicationInfo.setCategoryUniqueIds(java.util.List), ApplicationInfo.setCategoryLabels(java.util.List), Category

getOffset

public net.sourceforge.juint.UInt32 getOffset()
Gets the offset of the record this header represents.

Returns:
the offset

setOffset

public void setOffset(net.sourceforge.juint.UInt32 offset)
Sets the offset of the record this header represents.

Parameters:
offset - the offset

getUniqueId

public net.sourceforge.juint.UInt32 getUniqueId()
Gets the unique identifier of the record this header represents. What the identifier does is unknown.

Returns:
the unique identifier

setUniqueId

public void setUniqueId(net.sourceforge.juint.UInt32 uniqueId)
Sets the unique identifier of the record this header represents. Should always be set to 0.

Parameters:
uniqueId - the unique identifier

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