org.abstracthorizon.mercury.maildir.uid
Class UIDMessageWrapper

java.lang.Object
  extended by javax.mail.Message
      extended by javax.mail.internet.MimeMessage
          extended by org.abstracthorizon.mercury.maildir.util.MessageBase
              extended by org.abstracthorizon.mercury.maildir.util.MessageWrapper
                  extended by org.abstracthorizon.mercury.maildir.uid.UIDMessageWrapper
All Implemented Interfaces:
Comparable<UIDMessage>, javax.mail.internet.MimePart, javax.mail.Part, UIDMessage

public class UIDMessageWrapper
extends MessageWrapper
implements UIDMessage, Comparable<UIDMessage>

Message wrapper for UID messages created by UIDMaildirFolderData.

Author:
Daniel Sendula

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.mail.internet.MimeMessage
javax.mail.internet.MimeMessage.RecipientType
 
Field Summary
 
Fields inherited from class org.abstracthorizon.mercury.maildir.util.MessageWrapper
message
 
Fields inherited from class javax.mail.internet.MimeMessage
content, contentStream, dh, flags, headers, modified, saved
 
Fields inherited from class javax.mail.Message
expunged, folder, msgnum, session
 
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
 
Constructor Summary
protected UIDMessageWrapper(javax.mail.Folder folder, UIDMaildirMessage message, int msgnum)
          Constructor.
 
Method Summary
 int compareTo(UIDMessage o)
          Compares wrapped message's uid with supplied message's uid.
 boolean equals(Object o)
          Checks supplied message's uid against wrapped message's uid
 javax.mail.internet.MimeMessage getMessage()
          Returns wrapped message
 UID getUID()
          Returns supplied message's UID.
 
Methods inherited from class org.abstracthorizon.mercury.maildir.util.MessageWrapper
addFrom, addHeader, addHeaderLine, addRecipient, addRecipients, addRecipients, compareTo, getAllHeaderLines, getAllHeaders, getAllRecipients, getContent, getContentID, getContentLanguage, getContentMD5, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getFlags, getFrom, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getMessageID, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getReceivedDate, getRecipients, getReplyTo, getSender, getSentDate, getSize, getSubject, isExpunged, isMimeType, isSet, match, removeHeader, reply, saveChanges, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFlag, setFlags, setFrom, setFrom, setHeader, setMessage, setRecipient, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setSubject, setText, setText, writeTo, writeTo
 
Methods inherited from class org.abstracthorizon.mercury.maildir.util.MessageBase
setMessageNumber
 
Methods inherited from class javax.mail.internet.MimeMessage
createInternetHeaders, createMimeMessage, getContentStream, parse, setText, updateHeaders, updateMessageID
 
Methods inherited from class javax.mail.Message
getFolder, getMessageNumber, setExpunged
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIDMessageWrapper

protected UIDMessageWrapper(javax.mail.Folder folder,
                            UIDMaildirMessage message,
                            int msgnum)
                     throws javax.mail.MessagingException
Constructor.

Parameters:
folder - folder
message - message this message is based on
msgnum - message number
Throws:
javax.mail.MessagingException
Method Detail

getMessage

public javax.mail.internet.MimeMessage getMessage()
Returns wrapped message

Overrides:
getMessage in class MessageWrapper
Returns:
wrapped message

getUID

public UID getUID()
           throws javax.mail.MessagingException
Returns supplied message's UID.

Specified by:
getUID in interface UIDMessage
Returns:
supplied message's UID.
Throws:
javax.mail.MessagingException - never
javax.mail.MessagingException - if supplied message's getUID method throws it
IllegalStateException - if supplied message is null or not UIDMessage

equals

public boolean equals(Object o)
Checks supplied message's uid against wrapped message's uid

Overrides:
equals in class MessageWrapper
Parameters:
o - message to be compared with
Returns:
true if two messages have same uid and belong to folder with same full names

compareTo

public int compareTo(UIDMessage o)
Compares wrapped message's uid with supplied message's uid.

Specified by:
compareTo in interface Comparable<UIDMessage>
Parameters:
o - message to be compared with
Returns:
-1, 0 or 1. If supplied object is not of UIDMessage type it will return -1.


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.