javax.mail.event
Class MessageCountEvent

java.lang.Object
  extended by java.util.EventObject
      extended by javax.mail.event.MailEvent
          extended by javax.mail.event.MessageCountEvent
All Implemented Interfaces:
java.io.Serializable

public class MessageCountEvent
extends MailEvent

A change in the number of messages in a folder.

See Also:
Serialized Form

Field Summary
static int ADDED
          Messages were added to the folder.
protected  Message[] msgs
          The messages.
protected  boolean removed
          If true, this event is the result of an explicit expunge by this client.
static int REMOVED
          Messages were removed from the folder.
protected  int type
          The event type.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
MessageCountEvent(Folder source, int type, boolean removed, Message[] msgs)
          Constructor.
 
Method Summary
 void dispatch(java.lang.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 java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ADDED

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

See Also:
Constant Field Values

REMOVED

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

See Also:
Constant Field Values

type

protected int type
The event type.


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.


msgs

protected transient Message[] msgs
The messages.

Constructor Detail

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 Detail

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.


getMessages

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


dispatch

public void dispatch(java.lang.Object listener)
Invokes the appropriate listener method.

Specified by:
dispatch in class MailEvent