Save This Page
Home » apache-tomcat-6.0.16-src » javax » mail » [javadoc | source]
javax.mail
public class: Flags [javadoc | source]
java.lang.Object
   javax.mail.Flags

All Implemented Interfaces:
    Cloneable, Serializable

Representation of flags that may be associated with a message. Flags can either be system flags, defined by the Flag inner class, or user-defined flags defined by a String. The system flags represent those expected to be provided by most folder systems; user-defined flags allow for additional flags on a per-provider basis.

This class is Serializable but compatibility is not guaranteed across releases.

Nested Class Summary:
public static final class  Flags.Flag   
Constructor:
 public Flags() 
 public Flags(Flags.Flag flag) 
    Construct a Flags instance with a supplied system flag set.
    Parameters:
    flag - the system flag to set
 public Flags(Flags flags) 
    Construct a Flags instance with a same flags set.
    Parameters:
    flags - the instance to copy
 public Flags(String name) 
    Construct a Flags instance with the supplied user flags set. Question: should this automatically set the USER system flag?
    Parameters:
    name - the user flag to set
Method from javax.mail.Flags Summary:
add,   add,   add,   clone,   contains,   contains,   contains,   equals,   getSystemFlags,   getUserFlags,   hashCode,   remove,   remove,   remove
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.mail.Flags Detail:
 public  void add(Flags.Flag flag) 
    Set a system flag.
 public  void add(Flags flags) 
    Set all system and user flags from the supplied Flags. Question: do we need to check compatibility of USER flags?
 public  void add(String name) 
    Set a user flag. Question: should this fail if the USER system flag is not set?
 public Object clone() 
    Return a copy of this instance.
 public boolean contains(Flags.Flag flag) 
    See if the supplied system flags are set
 public boolean contains(Flags flags) 
    See if all of the supplied Flags are set
 public boolean contains(String name) 
    See if the supplied user flag is set
 public boolean equals(Object other) 
    Equality is defined as true if the other object is a instanceof Flags with the same system and user flags set (using a case-insensitive name comparison for user flags).
 public Flags.Flag[] getSystemFlags() 
    Return a list of Flags containing the system flags that have been set
 public String[] getUserFlags() 
    Return a list of user flags that have been set
 public int hashCode() 
    Calculate a hashCode for this instance
 public  void remove(Flags.Flag flag) 
    Unset the supplied system flag. Question: what happens if we unset the USER flags and user flags are set?
 public  void remove(Flags flags) 
    Unset all flags from the supplied instance.
 public  void remove(String name) 
    Unset the supplied user flag.