apps.email.util
Class MessageComparator

java.lang.Object
  |
  +--apps.email.util.MessageComparator
All Implemented Interfaces:
java.util.Comparator

public class MessageComparator
extends java.lang.Object
implements java.util.Comparator

A comparator used to order an array of Message objects.


Constructor Summary
MessageComparator(java.lang.String email_add)
          The constructor sets user_email.
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Takes two objects.
 boolean equals(java.lang.Object o1, java.lang.Object o2)
          Takes two objects.
 boolean hasAudio(javax.mail.Part part)
          Takes a java mail Part object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

MessageComparator

public MessageComparator(java.lang.String email_add)
The constructor sets user_email.
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Takes two objects. Casts the two objects to Message objects. Returns -1 is the first message should precede the second message in the array. Returns 0 if the two messages have the same priority. Returns 1 if the first message should preceed the second message.
Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - an object
o1 - an object
Returns:
an int

equals

public boolean equals(java.lang.Object o1,
                      java.lang.Object o2)
Takes two objects. Returns 1 if compare() returns 0. Otherwise, returns 0.
Parameters:
o1 - an object
o1 - an object
Returns:
an int

hasAudio

public boolean hasAudio(javax.mail.Part part)
                 throws javax.mail.MessagingException,
                        java.io.IOException
Takes a java mail Part object. Returns 1 if the object contains audio attachment(s). Otherwise, returns 0.
Parameters:
part - a java mail Part object
Returns:
a boolean