org.glasser.util.comparators |
|
Java Source File Name | Type | Comment |
BaseComparator.java | Class | This is a base class for Comparators which provides commonly-needed functionality.
Its three fields are:
- nullIsGreater (boolean)
which determines whether a null object
passed to compare() is considered greater than or less than a non-null object.
- sortDescending (boolean)
which determines whether the normal ordering
of two objects will be reversed, resulting in a descending sort.
- nestedComparator (Comparator)
when no order can be established for two objects
(in other words the compare() method would normally return 0) then the two objects
will be passed to the nestedComparator, in an attempt to determine an order. |
ListComparator.java | Class | This is a comparator class that's used to compare one List with another List.
The comparison is actually performed by comparing the Nth element of
the first List with the Nth element of the second list. |
MapComparator.java | Class | This Comparator is used for sorting a collection of Maps. |
MethodComparator.java | Class | This Comparator is used to compare two objects of a common type, based
on the value returned from a no-argument method common to both of them. |
MutableListComparator.java | Class | This class is essentially the same as ListComparator, except its fields
are exposed and mutable, and objects of this class are therefore not
threadsafe. |