com.syncbuilder.storage
Class Record

java.lang.Object
  |
  +--com.syncbuilder.storage.Block
        |
        +--com.syncbuilder.storage.Record
Direct Known Subclasses:
Record, Record, Record, Record, Record, Record, Record

public abstract class Record
extends Block

The base-class for representations of a database-record. This type is meant for storage-databases. The content of resource-databases is represented by com.syncbuilder.storage.Resource.

See Also:
Resource, Serialized Form

Field Summary
protected  boolean archived
           
static int ARCHIVED
           
protected  boolean busy
           
static int BUSY
           
protected  int category
           
static int CATEGORY_MASK
           
protected  boolean deleted
           
static int DELETED
           
protected  RecordID id
          The unique ID of the record.
protected  int index
           
protected  boolean modified
           
static int MODIFIED
           
protected  boolean secret
           
static int SECRET
           
 
Fields inherited from class com.syncbuilder.storage.Block
raw
 
Constructor Summary
Record()
           
Record(byte[] contents, RecordID id, int index, int attr, int category)
          Create a Record with the specified content and attributes.
 
Method Summary
 java.lang.String describe()
           
 java.lang.String describe(CategoryAppBlock appblock)
           
 boolean equals(java.lang.Object obj)
          Determine the equality of this Record and some other Object.
 void fill()
          Initialize the Record.
 int getCategory()
           
 int getFlags()
          Get a numerical representation of the flags
 RecordID getID()
           
 int getIndex()
           
 boolean hasID(RecordID id)
           
 boolean isArchived()
           
 boolean isBusy()
           
 boolean isDeleted()
           
 boolean isModified()
           
 boolean isSecret()
           
 void setArchived(boolean flag)
           
 void setBusy(boolean flag)
          Set the Busy attribute.
Busy is reserved for system use and should normally not be set by the user!
 void setCategory(int category)
           
 void setDeleted(boolean flag)
           
 void setFlags(int flags)
           
 void setID(RecordID id)
          Set a new RecordID for this record.
 void setIndex(int index)
           
 void setModified(boolean flag)
           
 void setSecret(boolean flag)
           
 
Methods inherited from class com.syncbuilder.storage.Block
pack, toString, unpack
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DELETED

public static final int DELETED

MODIFIED

public static final int MODIFIED

BUSY

public static final int BUSY

SECRET

public static final int SECRET

ARCHIVED

public static final int ARCHIVED

CATEGORY_MASK

public static final int CATEGORY_MASK

index

protected int index

category

protected int category

id

protected RecordID id
The unique ID of the record. This is guaranteed to be not null.

deleted

protected boolean deleted

modified

protected boolean modified

busy

protected boolean busy

secret

protected boolean secret

archived

protected boolean archived
Constructor Detail

Record

public Record()

Record

public Record(byte[] contents,
              RecordID id,
              int index,
              int attr,
              int category)
       throws java.lang.IllegalArgumentException
Create a Record with the specified content and attributes. The content which you specify as raw bytes is automatically processed by the unpack()-method to distribute it to the properties of the Record.
Parameters:
contents - the content in the native format of the PalmPilot application
id - the ID of the Record, or null if the ID shall be assigned by the Palm OS during HotSync.
index - the index of the Record
attr - the attributes. Use the DELETED, MODIFIED, BUSY, SECRET, and ARCHIVED flags. BUSY is reserved for system use and should normally not be set by the user.
category - the category of the Record. Use values from 0-15.
Method Detail

fill

public void fill()
Initialize the Record. All attributes are set to false. Index will be 0. Category is 0. ID will be assigned by the Palm OS when the Record is written to the device.
Overrides:
fill in class Block

describe

public java.lang.String describe()
Overrides:
describe in class Block

describe

public java.lang.String describe(CategoryAppBlock appblock)

equals

public boolean equals(java.lang.Object obj)
Determine the equality of this Record and some other Object.
Overrides:
equals in class java.lang.Object

isDeleted

public boolean isDeleted()

isModified

public boolean isModified()

isBusy

public boolean isBusy()

isSecret

public boolean isSecret()

isArchived

public boolean isArchived()

setDeleted

public void setDeleted(boolean flag)

setModified

public void setModified(boolean flag)

setBusy

public void setBusy(boolean flag)
Set the Busy attribute.
Busy is reserved for system use and should normally not be set by the user!

setSecret

public void setSecret(boolean flag)

setArchived

public void setArchived(boolean flag)

setFlags

public void setFlags(int flags)

getFlags

public int getFlags()
Get a numerical representation of the flags

getIndex

public int getIndex()

setIndex

public void setIndex(int index)

getID

public RecordID getID()

setID

public void setID(RecordID id)
Set a new RecordID for this record. You should use this method with caution, since it will only affect the in-memory representation of the Record, but will not automatically be written out to the Palm Device (use Database.putRecord()) for that. This may have disastrous results!

hasID

public boolean hasID(RecordID id)

getCategory

public int getCategory()

setCategory

public void setCategory(int category)
                 throws java.lang.IllegalArgumentException


This material is Copyrighted (C) 1999 by Tilo Christ. All Rights Reserved.