org.exolab.jms.lease
Class LeaseComparator

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

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

The LeaseComparator is usedto sort leases based on the expiration time

Version:
$Revision: 1.1 $ $Date: 2004/11/26 01:50:42 $
Author:
Jim Alateras

Constructor Summary
LeaseComparator()
           
 
Method Summary
 int compare(java.lang.Object obj1, java.lang.Object obj2)
          Compare two objects and return 0 if they are equal, a negative integer if the first argument is less than the second argument and a positive number if the first argument is greater than the second argument
 boolean equals(java.lang.Object comparator)
          Return true if the specified comparator matches this object and false otherwise
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeaseComparator

public LeaseComparator()
Method Detail

compare

public int compare(java.lang.Object obj1,
                   java.lang.Object obj2)
Compare two objects and return 0 if they are equal, a negative integer if the first argument is less than the second argument and a positive number if the first argument is greater than the second argument

It will throw ClassCastException if either obj1 or obj2 are not of type BaseLease

Specified by:
compare in interface java.util.Comparator
Parameters:
obj1 - first object to compare
obj2 - second object to compare
Returns:
int

equals

public boolean equals(java.lang.Object comparator)
Return true if the specified comparator matches this object and false otherwise
Specified by:
equals in interface java.util.Comparator
Overrides:
equals in class java.lang.Object
Parameters:
comparator - comparator to test
Returns:
boolean true if they are the same


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