| Home >> All >> org >> apache >> commons >> collections >> [ comparators Javadoc ] |
org.apache.commons.collections.comparators: Javadoc index of package org.apache.commons.collections.comparators.
Package Samples:
org.apache.commons.collections.comparators
Classes:
ComparatorChain: A ComparatorChain is a Comparator that wraps one or more Comparators in sequence. The ComparatorChain calls each Comparator in sequence until either 1) any single Comparator returns a non-zero result (and that result is then returned), or 2) the ComparatorChain is exhausted (and zero is returned). This type of sorting is very similar to multi-column sorting in SQL, and this class allows Java classes to emulate that kind of behaviour when sorting a List. To further facilitate SQL-like sorting, the order of any single Comparator in the list can be reversed. Calling a method that adds new Comparators ...
FixedOrderComparator: A Comparator which imposes a specific order on a specific set of Objects. Objects are presented to the FixedOrderComparator in a specified order and subsequent calls to compare 55 yield that order. For example: String[] planets = {"Mercury", "Venus", "Earth", "Mars"}; FixedOrderComparator distanceFromSun = new FixedOrderComparator(planets); Arrays.sort(planets); // Sort to alphabetical order Arrays.sort(planets, distanceFromSun); // Back to original order Once compare has been called, the FixedOrderComparator is locked and attempts to modify it yield an UnsupportedOperationException. Instances ...
ComparableComparator: A Comparator that compares Comparable objects. Throws ClassCastExceptions if the objects are not Comparable, or if they are null. Throws ClassCastException if the compareTo of both objects do not provide an inverse result of each other as per the Comparable javadoc. This Comparator is useful, for example, for enforcing the natural order in custom implementations of SortedSet and SortedMap.
BooleanComparator: A java.util.Comparator for java.lang.Boolean objects that can sort either true or false first.
TransformingComparator: Decorates another Comparator with transformation behavior. That is, the return value from the transform operation will be passed to the decorated Comparator#compare method.
TestBooleanComparator: Tests for BooleanComparator .
AbstractTestComparator: Abstract test class for testing the Comparator interface. Concrete subclasses declare the comparator to be tested. They also declare certain aspects of the tests.
NullComparator: A Comparator that will compare nulls to be either lower or higher than other objects.
TestAll: Entry point for all Comparator Collections tests.
ReverseComparator: Reverses the order of another comparator.
TestFixedOrderComparator: Test class for FixedOrderComparator.
TestNullComparator: Test the NullComparator
TestReverseComparator
TestComparableComparator
TestComparatorChain
TestComparator
| Home | Contact Us | Privacy Policy | Terms of Service |