com.esri.aims.mtier.model.util
Class ToStringComparator
java.lang.Object
com.esri.aims.mtier.model.util.ToStringComparator
- All Implemented Interfaces:
- Comparator
public class ToStringComparator
- extends Object
- implements Comparator
Compares two objects using their toString()
methods.
- See Also:
Collections
Method Summary |
int |
compare(Object object1,
Object object2)
Compares two objects by their toString() method and returns an
integer N where N<0, N=0, or N>0
if the value of object1.toString().toUpper() is less than,
equal to, or greater than object1.toString().toUpper() . |
boolean |
equals(Object object)
Uses default implementation. |
comparator
public static final ToStringComparator comparator
- The static instance of this object can be used as the comparator for
most occasions. If you are going to use this object heavily, create another
instance.
ToStringComparator
public ToStringComparator()
compare
public int compare(Object object1,
Object object2)
- Compares two objects by their toString() method and returns an
integer
N
where N<0, N=0,
or N>0
if the value of object1.toString().toUpper()
is less than,
equal to, or greater than object1.toString().toUpper()
.
- Specified by:
compare
in interface Comparator
- Parameters:
object1
- The first object to be compared.object2
- The second object to be compared.
- Returns:
- (see comments)
equals
public boolean equals(Object object)
- Uses default implementation.
- Specified by:
equals
in interface Comparator
- Overrides:
equals
in class Object