net.sf.jga.fn.comparison

Class Min<T>

public class Min<T extends Comparable> extends AbstractBinaryFunctor<T,T,T> implements Serializable

Binary Functor that returns the lesser of two Comparable arguments x and y. If x == y, returns x (somewhat arbitrarily). Null values are not considered comparable, and a NullPointerException will be thrown if either argument is null.

Copyright © 2003 David A. Hall

Author: David A. Hall

Nested Class Summary
interfaceMin.Visitor
Interface for classes that may interpret a Min predicate.
Method Summary
voidaccept(Visitor v)
Calls the Visitor's visit(Min) method, if it implements the nested Visitor interface.
Tfn(T x, T y)
Returns the lesser of two arguments, or the first if they are equal.
StringtoString()

Method Detail

accept

public void accept(Visitor v)
Calls the Visitor's visit(Min) method, if it implements the nested Visitor interface.

fn

public T fn(T x, T y)
Returns the lesser of two arguments, or the first if they are equal.

Returns: the lesser of two arguments, or the first if they are equal.

toString

public String toString()