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 int
ADDED
Messages were added to the folder.
static int
REMOVED
Messages were removed from the folder.
protected Message[]
msgs
The affected messages.
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.
protected int
type
The event type.

Constructor Summary

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

Method Summary

void
dispatch(Object listener)
Message[]
getMessages()
Return the affected messages.
int
getType()
Return the event type.
boolean
isRemoved()

Methods inherited from class javax.mail.event.MailEvent

dispatch

Field Details

ADDED

public static final int ADDED
Messages were added to the folder.
Field Value:
1

REMOVED

public static final int REMOVED
Messages were removed from the folder.
Field Value:
2

msgs

protected 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.

type

protected int type
The event type.

Constructor Details

MessageCountEvent

public MessageCountEvent(Folder folder,
                         int type,
                         boolean removed,
                         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

Method Details

dispatch

public void dispatch(Object listener)
Overrides:
dispatch in interface MailEvent

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