org.exolab.jms.persistence
Class IdKeyComparator
java.lang.Object
|
+--org.exolab.jms.persistence.IdKeyComparator
- All Implemented Interfaces:
- java.util.Comparator, java.io.Serializable
- public class IdKeyComparator
- extends java.lang.Object
- implements java.util.Comparator, java.io.Serializable
A comparator class that iplements a string comparison.
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
- See Also:
- Serialized Form
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 |
IdKeyComparator
public IdKeyComparator()
- Default constructor does nothing.
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 compareObject
- 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.