Class TransformingComparator
- java.lang.Object
-
- org.apache.commons.collections.comparators.TransformingComparator
-
- All Implemented Interfaces:
Comparator
@Deprecated(since="2021-04-30") public class TransformingComparator extends Object implements Comparator
Deprecated.Commons Collections 3 is in maintenance mode. Commons Collections 4 should be used instead.Decorates another Comparator with transformation behavior. That is, the return value from the transform operation will be passed to the decoratedcomparemethod.- Since:
- Commons Collections 2.0 (?)
- See Also:
Transformer,ComparableComparator
-
-
Constructor Summary
Constructors Constructor Description TransformingComparator(Transformer transformer)Deprecated.Constructs an instance with the given Transformer and aComparableComparator.TransformingComparator(Transformer transformer, Comparator decorated)Deprecated.Constructs an instance with the given Transformer and Comparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intcompare(Object obj1, Object obj2)Deprecated.Returns the result of comparing the values from the transform operation.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Constructor Detail
-
TransformingComparator
public TransformingComparator(Transformer transformer)
Deprecated.Constructs an instance with the given Transformer and aComparableComparator.- Parameters:
transformer- what will transform the arguments tocompare
-
TransformingComparator
public TransformingComparator(Transformer transformer, Comparator decorated)
Deprecated.Constructs an instance with the given Transformer and Comparator.- Parameters:
transformer- what will transform the arguments tocomparedecorated- the decorated Comparator
-
-
Method Detail
-
compare
public int compare(Object obj1, Object obj2)
Deprecated.Returns the result of comparing the values from the transform operation.- Specified by:
comparein interfaceComparator- Parameters:
obj1- the first object to transform then compareobj2- the second object to transform then compare- Returns:
- negative if obj1 is less, positive if greater, zero if equal
-
-