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:
Serializable

public class MessageCountEvent
extends MailEvent

Event indicating a change in the number of messages in a folder.

Version:
$Rev: 467553 $ $Date: 2006-10-25 00:01:51 -0400 (Wed, 25 Oct 2006) $
See Also:
Serialized Form

Field Summary
static int ADDED
          Messages were added to 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.
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 folder, int type, boolean removed, Message[] 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 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

msgs

protected transient Message[] msgs
The affected messages.


type

protected int type
The event type.


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.

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

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

getMessages

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

Returns:
the affected messages

dispatch

public void dispatch(Object listener)
Specified by:
dispatch in class MailEvent


Copyright © 2003-2009 The Apache Software Foundation. All Rights Reserved.