com.compoze.mail
Class MessageComparator
java.lang.Object
|
+--com.compoze.mail.MessageComparator
- All Implemented Interfaces:
- java.util.Comparator, java.io.Serializable
- public class MessageComparator
- extends java.lang.Object
- implements java.util.Comparator, java.io.Serializable
This class can perform a comparison of messages.
Use this comparator with the Collections
sort
method to sort a collection of messages.
- See Also:
- Serialized Form
Field Summary |
static int |
ORDER_ASCENDING
Sorts the message in ascending order (0-9, A-Z, a-z). |
static int |
ORDER_DESCENDING
Sorts the message in descending order (z-a, Z-A, 9-0). |
Method Summary |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compares its two message objects for order. |
java.lang.String |
getOrderBy()
Gets the order by string. |
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 |
ORDER_ASCENDING
public static final int ORDER_ASCENDING
- Sorts the message in ascending order (0-9, A-Z, a-z).
ORDER_DESCENDING
public static final int ORDER_DESCENDING
- Sorts the message in descending order (z-a, Z-A, 9-0).
MessageComparator
public MessageComparator()
- Constructor. Creates a comparator with sorting by
message sent date in descending order.
MessageComparator
public MessageComparator(int iAttribute,
int iOrder)
- Constructor.
- Parameters:
iAttribute
- the message attribute to sort byiOrder
- the sorting by order (see ORDER_ constants)- See Also:
MessageComparator.IAttributes
compare
public int compare(java.lang.Object o1,
java.lang.Object o2)
- Compares its two message objects for order.
Returns a negative integer, zero, or
a positive integer as the first message is less than, equal to, or greater
than the second.
- Specified by:
compare
in interface java.util.Comparator
- Parameters:
o1
- the first message object to compareo2
- the second message object to compare- See Also:
Comparator
,
MessageComparator.IAttributes
getOrderBy
public java.lang.String getOrderBy()
- Gets the order by string.
- Returns:
- the order by
Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.