com.funambol.mail
Class MessageFlags

java.lang.Object
  extended by com.funambol.mail.MessageFlags

public class MessageFlags
extends java.lang.Object

An object used to determine the state of a Message within a Folder and the flags related to this Message.


Field Summary
static int ANSWERED
          This message has been answered.
static int DELETED
          This message is marked as deleted.
static int DRAFT
          This message is a draft.
static int FLAGGED
          This message is flagged.
static int FORWARDED
          This message has been forwarded.
static int OPENED
          This message is seen.
static int PARTIAL
          This message has been partially downloaded from the server.
static int TX_ERROR
          The message has not been sent due to an error during the transmission.
static int TX_SENDING
          The message is queued for sending: the next sync with the server will process this message.
static int TX_SENT
          The message has been sent successfully by this client.
 
Constructor Summary
MessageFlags()
          Default constructor
MessageFlags(MessageFlags mf)
           
 
Method Summary
 void clearFlags()
          Reset all the flags.
 void clearFlags(int mask)
          Reset the flags specified by mask.
 int[] compareFlags(MessageFlags newMask)
          Compare the current object with the given mask
 void deserialize(java.io.DataInputStream in)
          Read object field from the input stream.
 int getFlags()
          Returns the flag mask for this message.
 boolean isSet(int flag)
          Set the message flags according to the given mask
 void merge(MessageFlags f1)
          Merge the current object with the given mask
 void merge(MessageFlags f1, boolean enableDelayedFlags)
          Merge the current object with the given mask.
 void serialize(java.io.DataOutputStream out)
          Write object fields to the output stream.
 void setFlag(int flag, boolean set)
          Set the specified flag
 void setFlags(int mask)
          Set the message flags according to the given mask
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ANSWERED

public static final int ANSWERED
This message has been answered. This flag is set by clients to indicate that this message has been answered to

See Also:
Constant Field Values

FORWARDED

public static final int FORWARDED
This message has been forwarded. This flag is set by clients to indicate that this message has been forwarded to

See Also:
Constant Field Values

OPENED

public static final int OPENED
This message is seen. This flag is set by clients to indicate that this message has been opened by the user.

See Also:
Constant Field Values

DRAFT

public static final int DRAFT
This message is a draft. This flag is set by clients

See Also:
Constant Field Values

FLAGGED

public static final int FLAGGED
This message is flagged. No semantic is predefined for this flag. Clients alter this flag

See Also:
Constant Field Values

DELETED

public static final int DELETED
This message is marked as deleted. Clients set this flag to mark a message as deleted. The expunge operation on a folder removes all messages in that folder that are marked for deletion

See Also:
Constant Field Values

PARTIAL

public static final int PARTIAL
This message has been partially downloaded from the server. It may contain only the headers, or a part of the body. Clients can use this flags to inform the user that more data are available.

See Also:
Constant Field Values

TX_SENDING

public static final int TX_SENDING
The message is queued for sending: the next sync with the server will process this message.

See Also:
Constant Field Values

TX_SENT

public static final int TX_SENT
The message has been sent successfully by this client.

See Also:
Constant Field Values

TX_ERROR

public static final int TX_ERROR
The message has not been sent due to an error during the transmission.

See Also:
Constant Field Values
Constructor Detail

MessageFlags

public MessageFlags()
Default constructor


MessageFlags

public MessageFlags(MessageFlags mf)
Method Detail

clearFlags

public void clearFlags()
Reset all the flags.


clearFlags

public void clearFlags(int mask)
Reset the flags specified by mask.

Parameters:
mask - a bit mask with the flags to clear set to 1.

getFlags

public int getFlags()
Returns the flag mask for this message.

Returns:
the flag mask for this message.

setFlag

public void setFlag(int flag,
                    boolean set)
Set the specified flag

Parameters:
flag - the flag mask for this message (see com.funambol.mail.Message)

setFlags

public void setFlags(int mask)
Set the message flags according to the given mask


isSet

public boolean isSet(int flag)
Set the message flags according to the given mask

Returns:
the flag mask for this message.

merge

public void merge(MessageFlags f1)
Merge the current object with the given mask

Parameters:
f1 - is the MessageFlags with the values to be merged

merge

public void merge(MessageFlags f1,
                  boolean enableDelayedFlags)
Merge the current object with the given mask. The flags of the current object will be entirely overridden with the given mask.

Parameters:
f1 - is the MessageFlags with the values to be merged
enableDelayedFlags - is used to enable the update of answer and forward flag

compareFlags

public int[] compareFlags(MessageFlags newMask)
Compare the current object with the given mask

Parameters:
newMask - is the mask to be compared
Returns:
int[] with the comparison result

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

serialize

public void serialize(java.io.DataOutputStream out)
               throws java.io.IOException
Write object fields to the output stream.

Parameters:
out - Output stream
Throws:
java.io.IOException

deserialize

public void deserialize(java.io.DataInputStream in)
                 throws java.io.IOException
Read object field from the input stream.

Parameters:
in - Input stream
Throws:
java.io.IOException


Copyright © 2001-2009 Funambol.