superwaba.ext.palm.io.builtin
Class Mail

java.lang.Object
  |
  +--superwaba.ext.palm.io.builtin.Mail

public class Mail
extends Object
implements Storable

Provides a link to the standard Palm Mail database..


Field Summary
 byte addressing
          addressing value 0-3
 String bcc
          the bcc list
 String body
          the text
 String cc
          the cc list
 boolean confirmDelivery
          Confirm Delivery?
 boolean confirmRead
          Confirm read?
 Time date
          the date if any
 boolean dated
          Is there a date?
 String from
          the sender of the mail
 byte priority
          priority value 0-3
static int PRIORITY_HIGH
          Indicates a high priority message
static int PRIORITY_LOW
          Indicates a low priority message
static int PRIORITY_NORMAL
          Indicates a normal priority message
 boolean read
          Has this message been read
static int REC_ATTR_DELETED
          Indicates a message for the Deleted category
static int REC_ATTR_DRAFT
          Indicates a message that has been saved as draft
static int REC_ATTR_FILED
          Indicates a message that has been filed
static int REC_ATTR_INBOX
          Indicates a message for the In box
static int REC_ATTR_OUTBOX
          Indicates a message for the Out box
 String replyTo
          the author of the mail's preferred address
 String sentTo
          the actual recipient of the mail
 boolean signature
          Is there a .sig attached
 String subject
          the subject of the mail
 String to
          the recipient of the mail
 
Constructor Summary
Mail()
          Constructs a new empty address
 
Method Summary
static boolean addMail(Mail mail)
          Adds a new Mail to the database
static boolean addMail(Mail mail, int category)
          Adds a new Mail to the database
 byte getID()
          Gets a unique ID for this class.
 Storable getInstance()
          Returns an object of the same class as this object.
static Mail getMail(int i)
          Gets a Mail from the database
static boolean getMail(int i, Mail mail)
          Gets a Mail from the database and places it into the given Mail.
 void loadState(DataStream ds)
          Load state information from the given DataStream into this object If any Storable objects need to be loaded as part of the state, their loadState() method can be called too.
static int mailCount()
          Gets the number of mails in the database
 void saveState(DataStream ds)
          Send the state information of this object to the given object catalog using the given DataStream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, toString, wait, wait
 

Field Detail

REC_ATTR_INBOX

public static final int REC_ATTR_INBOX
Indicates a message for the In box

REC_ATTR_OUTBOX

public static final int REC_ATTR_OUTBOX
Indicates a message for the Out box

REC_ATTR_DELETED

public static final int REC_ATTR_DELETED
Indicates a message for the Deleted category

REC_ATTR_FILED

public static final int REC_ATTR_FILED
Indicates a message that has been filed

REC_ATTR_DRAFT

public static final int REC_ATTR_DRAFT
Indicates a message that has been saved as draft

PRIORITY_HIGH

public static final int PRIORITY_HIGH
Indicates a high priority message

PRIORITY_NORMAL

public static final int PRIORITY_NORMAL
Indicates a normal priority message

PRIORITY_LOW

public static final int PRIORITY_LOW
Indicates a low priority message

read

public boolean read
Has this message been read

signature

public boolean signature
Is there a .sig attached

confirmRead

public boolean confirmRead
Confirm read?

confirmDelivery

public boolean confirmDelivery
Confirm Delivery?

priority

public byte priority
priority value 0-3

addressing

public byte addressing
addressing value 0-3

dated

public boolean dated
Is there a date?

date

public Time date
the date if any

subject

public String subject
the subject of the mail

from

public String from
the sender of the mail

to

public String to
the recipient of the mail

cc

public String cc
the cc list

bcc

public String bcc
the bcc list

replyTo

public String replyTo
the author of the mail's preferred address

sentTo

public String sentTo
the actual recipient of the mail

body

public String body
the text
Constructor Detail

Mail

public Mail()
Constructs a new empty address
Method Detail

mailCount

public static int mailCount()
Gets the number of mails in the database
Returns:
the number of mails

getMail

public static Mail getMail(int i)
Gets a Mail from the database
Parameters:
i - the index to get
Returns:
the retrieved mail

getMail

public static boolean getMail(int i,
                              Mail mail)
Gets a Mail from the database and places it into the given Mail. Any previous data in the mail is erased.
Parameters:
i - the index to get
mail - the mail object to place the mail into.

addMail

public static boolean addMail(Mail mail)
Adds a new Mail to the database
Parameters:
mail - the Mail to add
Returns:
true if successful, false otherwise

addMail

public static boolean addMail(Mail mail,
                              int category)
Adds a new Mail to the database
Parameters:
mail - the Mail to add
category - The mail folder REC_ATTR_* category to set. Defaults to OUTBOX if invalid
Returns:
true if successful, false otherwise

saveState

public void saveState(DataStream ds)
Send the state information of this object to the given object catalog using the given DataStream. If any Storable objects need to be saved as part of the state, their saveState() method can be called too.
Specified by:
saveState in interface Storable

loadState

public void loadState(DataStream ds)
Load state information from the given DataStream into this object If any Storable objects need to be loaded as part of the state, their loadState() method can be called too.
Specified by:
loadState in interface Storable

getID

public byte getID()
Gets a unique ID for this class. It is up to the user to ensure that the ID of each class of Storable contained in a single ObjectCatalog is unique and the ID of each instance in a class is the same.
Specified by:
getID in interface Storable

getInstance

public Storable getInstance()
Returns an object of the same class as this object.
Specified by:
getInstance in interface Storable
Returns:
a class. Any data is irrelevent.