net.sf.jga.util

Class GenericComparator<T,R>

public class GenericComparator<T,R extends Comparable> extends Object implements Comparator<T>

Comparator that applies a functor to each argument, then compares the results. The functor must return Comparable values.

Copyright © 2003 David A. Hall

Author: David A. Hall

Constructor Summary
GenericComparator(UnaryFunctor<T,R> fn)
Method Summary
intcompare(T x, T y)

Constructor Detail

GenericComparator

public GenericComparator(UnaryFunctor<T,R> fn)

Method Detail

compare

public int compare(T x, T y)