org.exolab.jms.persistence
Class IdMessageComparator

java.lang.Object
  |
  +--org.exolab.jms.persistence.IdMessageComparator
All Implemented Interfaces:
java.util.Comparator

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

A comparator class that iplements a message id comparison for PersistentMessage.

Note this class assumes that id's are in some sort of order, such that an earlier generated id is less than a later generated id.

Version:
$Revision: 1.4 $ $Date: 2003/08/17 01:32:25 $
Author:
Jim Mourikis

Constructor Summary
IdMessageComparator()
          Default constructor does nothing.
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Implements the compare operator.
 boolean equals(java.lang.Object ob)
          Indicates whether some other object is "equal to" this Comparator.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdMessageComparator

public IdMessageComparator()
Default constructor does nothing.
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
            throws java.lang.ClassCastException,
                   java.lang.NullPointerException
Implements the compare operator. Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
Specified by:
compare in interface java.util.Comparator
Parameters:
Object - object 1 to compare
Object - object 2 ro compare to.
Returns:
int returns -1, 0, 1 if the first argument is less than, equal to, or greater than the second.
Throws:
java.lang.ClassCastException - if object types are unknown

equals

public boolean equals(java.lang.Object ob)
Indicates whether some other object is "equal to" this Comparator. This method must obey the general contract of Object.equals(Object).
Specified by:
equals in interface java.util.Comparator
Overrides:
equals in class java.lang.Object
Parameters:
Object - the object to compare to
Returns:
boolean true iff objects are equal


Copyright © 1999-2004 The OpenJMS Group. All Rights Reserved.