javax.mail.event

Class MessageCountEvent


public class MessageCountEvent
extends MailEvent

A change in the number of messages in a folder.
Version:
1.4
Author:
Chris Burdess

Field Summary

static int
ADDED
Messages were added to the folder.
static int
REMOVED
Messages were removed from the folder.
protected Message[]
msgs
The messages.
protected boolean
removed
If true, this event is the result of an explicit expunge by this client.
protected int
type
The event type.

Constructor Summary

MessageCountEvent(Folder source, int type, boolean removed, Message[] msgs)
Constructor.

Method Summary

void
dispatch(Object listener)
Invokes the appropriate listener method.
Message[]
getMessages()
Returns the messages that were added or removed.
int
getType()
Returns the type of this event.
boolean
isRemoved()
Indicates whether this event is the result of an explicit expunge, or of an expunge by an external mechanism.

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

removed

protected boolean removed
If true, this event is the result of an explicit expunge by this client. Otherwise this event is the result of an expunge by external mechanisms.

type

protected int type
The event type.

Constructor Details

MessageCountEvent

public MessageCountEvent(Folder source,
                         int type,
                         boolean removed,
                         Message[] msgs)
Constructor.
Parameters:
source - the folder
type - the event type (ADDED or REMOVED)
removed - whether this event is the result of a specific expunge
msgs - the messages added or removed

Method Details

dispatch

public void dispatch(Object listener)
Invokes the appropriate listener method.
Overrides:
dispatch in interface MailEvent

getMessages

public Message[] getMessages()
Returns the messages that were added or removed.

getType

public int getType()
Returns the type of this event.

isRemoved

public boolean isRemoved()
Indicates whether this event is the result of an explicit expunge, or of an expunge by an external mechanism.

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