net.sf.javagimmicks.collections.transformer.TransformingComparator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gimmicks Show documentation
Show all versions of gimmicks Show documentation
Utility classes, APIs and tools for Java
package net.sf.javagimmicks.collections.transformer;
import java.util.Comparator;
import net.sf.javagimmicks.util.Function;
class TransformingComparator implements Comparator
{
protected final Comparator super F> _internalComparator;
private final Function _transformer;
/**
* @deprecated Use TranformerUtils.decorate() instead
*/
@Deprecated
public TransformingComparator(Comparator super F> comparator, Function transformer)
{
_internalComparator = comparator;
_transformer = transformer;
}
public int compare(T o1, T o2)
{
return _internalComparator.compare(_transformer.apply(o1), _transformer.apply(o2));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy