javax.mail.event

Class MessageCountEvent

public class MessageCountEvent extends MailEvent

Event indicating a change in the number of messages in a folder.
Field Summary
static intADDED
Messages were added to the folder.
protected Message[]msgs
The affected messages.
protected booleanremoved
If true, then messages were expunged from the folder by this client and message numbers reflect the deletion; if false, then the change was the result of an expunge by a different client.
static intREMOVED
Messages were removed from the folder.
protected inttype
The event type.
Constructor Summary
MessageCountEvent(Folder folder, int type, boolean removed, Message[] messages)
Construct a new event.
Method Summary
voiddispatch(Object listener)
Message[]getMessages()
Return the affected messages.
intgetType()
Return the event type.
booleanisRemoved()

Field Detail

ADDED

public static final int ADDED
Messages were added to the folder.

msgs

protected transient Message[] msgs
The affected messages.

removed

protected boolean removed
If true, then messages were expunged from the folder by this client and message numbers reflect the deletion; if false, then the change was the result of an expunge by a different client.

REMOVED

public static final int REMOVED
Messages were removed from the folder.

type

protected int type
The event type.

Constructor Detail

MessageCountEvent

public MessageCountEvent(Folder folder, int type, boolean removed, Message[] messages)
Construct a new event.

Parameters: folder the folder containing the messages type the event type removed indicator of whether messages were expunged by this client messages the affected messages

Method Detail

dispatch

public void dispatch(Object listener)

getMessages

public Message[] getMessages()
Return the affected messages.

Returns: the affected messages

getType

public int getType()
Return the event type.

Returns: the event type

isRemoved

public boolean isRemoved()

Returns: whether this event was the result of an expunge by this client

See Also: removed