net.sf.jga.fn.comparison

Class Max<T>

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

Binary Functor that returns the greater 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
interfaceMax.Visitor
Interface for classes that may interpret a Max predicate.
Method Summary
voidaccept(Visitor v)
Calls the Visitor's visit(Max) method, if it implements the nested Visitor interface.
Tfn(T x, T y)
Returns the greater of two arguments, or the first if they are equal.
StringtoString()

Method Detail

accept

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

fn

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

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

toString

public String toString()