com.sun.mail.imap
Class MessageCache

java.lang.Object
  extended by com.sun.mail.imap.MessageCache

public class MessageCache
extends Object

A cache of IMAPMessage objects along with the mapping from message number to IMAP sequence number. All operations on this object are protected by the messageCacheLock in IMAPFolder.


Method Summary
 void addMessages(int count)
          Add count messages to the cache.
 void expungeMessage(int seqnum)
          Expunge the message with the given sequence number.
 IMAPMessage getMessage(int msgnum)
          Get the message object for the indicated message number.
 IMAPMessage getMessageBySeqnum(int seqnum)
          Get the message object for the indicated sequence number.
 IMAPMessage[] removeExpungedMessages()
          Remove all the expunged messages from the array, returning a list of removed message objects.
 IMAPMessage[] removeExpungedMessages(Message[] msgs)
          Remove expunged messages in msgs from the array, returning a list of removed message objects.
 int seqnumOf(int msgnum)
          Return the sequence number for the given message number.
 int size()
          Size of cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

size

public int size()
Size of cache.


getMessage

public IMAPMessage getMessage(int msgnum)
Get the message object for the indicated message number. If the message object hasn't been created, create it.


getMessageBySeqnum

public IMAPMessage getMessageBySeqnum(int seqnum)
Get the message object for the indicated sequence number. If the message object hasn't been created, create it. Return null if there's no message with that sequence number.


expungeMessage

public void expungeMessage(int seqnum)
Expunge the message with the given sequence number.


removeExpungedMessages

public IMAPMessage[] removeExpungedMessages()
Remove all the expunged messages from the array, returning a list of removed message objects.


removeExpungedMessages

public IMAPMessage[] removeExpungedMessages(Message[] msgs)
Remove expunged messages in msgs from the array, returning a list of removed message objects. All messages in msgs must be IMAPMessage objects from this folder.


addMessages

public void addMessages(int count)
Add count messages to the cache.


seqnumOf

public int seqnumOf(int msgnum)
Return the sequence number for the given message number.



Copyright © 2011 Sun Microsystems, Inc.. All Rights Reserved.