Overview | Package | Class | Tree | Deprecated | Index | Help
| Compoze Software, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Inner Class Summary
`static interface` | `MessageComparator.IAttributes` This inner class represents message attributes used for sorting messages.

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).

Constructor Summary
`MessageComparator()` Constructor.
`MessageComparator(int iAttribute, int iOrder)` Constructor.

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`

Field Detail

### 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).

Constructor Detail

### 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 by
    `iOrder` - the sorting by order (see ORDER_ constants)
  See Also:
    `MessageComparator.IAttributes`

Method Detail

### 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 compare
    `o2` - 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

Overview | Package | Class | Tree | Deprecated | Index | Help
| Compoze Software, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.