org.apache.commons.collections.comparators
Class TransformingComparator
java.lang.Object
org.apache.commons.collections.comparators.TransformingComparator
- All Implemented Interfaces:
- java.util.Comparator
public class TransformingComparator
- extends java.lang.Object
- implements java.util.Comparator
Decorates another Comparator with transformation behavior. That is, the
return value from the transform operation will be passed to the decorated
Comparator#compare
method.
- See Also:
Transformer
,
ComparableComparator
Method Summary |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Returns the result of comparing the values from the transform operation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
equals |
decorated
protected java.util.Comparator decorated
transformer
protected Transformer transformer
TransformingComparator
public TransformingComparator(Transformer transformer)
- Constructs an instance with the given Transformer and a ComparableComparator.
- Parameters:
transformer
- what will transform the instance.
TransformingComparator
public TransformingComparator(Transformer transformer,
java.util.Comparator decorated)
- Constructs an instance with the given Transformer and Comparator
- Parameters:
decorated
- the decorated ComparatorgetterName
- the getter name
compare
public int compare(java.lang.Object o1,
java.lang.Object o2)
- Returns the result of comparing the values from the transform operation.
- Specified by:
compare
in interface java.util.Comparator
- Returns:
- the result of comparing the values from the transform operation
Copyright © 2001-2004 Apache Software Foundation. Documenation generated March 28 2013.