net.sf.jga.fn.algorithm
public class MinValue<T> extends AbstractUnaryFunctor<Collection<? extends T>,T> implements Serializable
Copyright © 2003 David A. Hall
Nested Class Summary | |
---|---|
interface | MinValue.Visitor
Interface for classes that may interpret an MinValue functor. |
Constructor Summary | |
---|---|
MinValue(Comparator<T> comp)
Builds a MinValue functor that will use the given comparator to
compare elements in the collection. |
Method Summary | |
---|---|
void | accept(Visitor v)
Calls the Visitor's visit(MinValue) method, if it
implements the nested Visitor interface. |
T | fn(Collection<? extends T> collection)
Return the smallest value in the collection |
Comparator<T> | getComparator()
Returns the functor used to order values in the collection. |
String | toString() |
Throws: IllegalArgumentException if the Comparator is null
visit(MinValue)
method, if it
implements the nested Visitor interface.Throws: NoSuchElementException if the collection is empty