org.apache.commons.collections.comparators
public class TransformingComparator extends Object implements Comparator
Comparator#compare(Object,Object) compare
method.
Since: Commons Collections 2.0 (?)
Version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
See Also: Transformer ComparableComparator
Field Summary | |
---|---|
protected Comparator | decorated The decorated comparator. |
protected Transformer | transformer The transformer being used. |
Constructor Summary | |
---|---|
TransformingComparator(Transformer transformer)
Constructs an instance with the given Transformer and a
ComparableComparator .
| |
TransformingComparator(Transformer transformer, Comparator decorated)
Constructs an instance with the given Transformer and Comparator.
|
Method Summary | |
---|---|
int | compare(Object obj1, Object obj2)
Returns the result of comparing the values from the transform operation.
|
ComparableComparator
.
Parameters: transformer what will transform the arguments to compare
Parameters: transformer what will transform the arguments to compare
decorated the decorated Comparator
Parameters: obj1 the first object to transform then compare obj2 the second object to transform then compare
Returns: negative if obj1 is less, positive if greater, zero if equal