javax.mail

Class Flags

Implemented Interfaces:
Cloneable, Serializable

public class Flags
extends java.lang.Object
implements Cloneable, Serializable

The set of flags on a message. Flags are composed of predefined system flags (Flags.Flag), and user defined flags (case-independent String).
Version:
1.4
Author:
Chris Burdess

Nested Class Summary

static class
Flags.Flag
An individual system flag.

Constructor Summary

Flags()
Construct an empty Flags object.
Flags(String flag)
Construct a Flags object containing the given user flag.
Flags(Flags flags)
Construct a Flags object containing the given flags.
Flags(Flags.Flag flag)
Construct a Flags object containing the given system flag.

Method Summary

void
add(String flag)
Add the specified user flag.
void
add(Flags flags)
Add all the flags from the specified Flags object.
void
add(Flags.Flag flag)
Add the specified system flag.
Object
clone()
boolean
contains(String flag)
Indicates whether the specified user flag is set.
boolean
contains(Flags flags)
Indicates whether all the flags in the specified Flags object are set in this Flags object.
boolean
contains(Flags.Flag flag)
Indicates whether the specified system flag is set.
boolean
equals(Object other)
Flags.Flag[]
getSystemFlags()
Returns the system flags.
String[]
getUserFlags()
Returns the user flags.
int
hashCode()
void
remove(String flag)
Remove the specified user flag.
void
remove(Flags flags)
Remove all flags in the given Flags object from this Flags object.
void
remove(Flags.Flag flag)
Remove the specified system flag.

Constructor Details

Flags

public Flags()
Construct an empty Flags object.

Flags

public Flags(String flag)
Construct a Flags object containing the given user flag.

Flags

public Flags(Flags flags)
Construct a Flags object containing the given flags.

Flags

public Flags(Flags.Flag flag)
Construct a Flags object containing the given system flag.

Method Details

add

public void add(String flag)
Add the specified user flag.

add

public void add(Flags flags)
Add all the flags from the specified Flags object.

add

public void add(Flags.Flag flag)
Add the specified system flag.

clone

public Object clone()

contains

public boolean contains(String flag)
Indicates whether the specified user flag is set.

contains

public boolean contains(Flags flags)
Indicates whether all the flags in the specified Flags object are set in this Flags object.

contains

public boolean contains(Flags.Flag flag)
Indicates whether the specified system flag is set.

equals

public boolean equals(Object other)

getSystemFlags

public Flags.Flag[] getSystemFlags()
Returns the system flags.

getUserFlags

public String[] getUserFlags()
Returns the user flags.

hashCode

public int hashCode()

remove

public void remove(String flag)
Remove the specified user flag.

remove

public void remove(Flags flags)
Remove all flags in the given Flags object from this Flags object.

remove

public void remove(Flags.Flag flag)
Remove the specified system flag.

© Copyright 2003, 2004 The Free Software Foundation, All rights reserved