org.springframework.rules.closure
Class Maximum

java.lang.Object
  extended by org.springframework.core.closure.support.AlgorithmsAccessor
      extended by org.springframework.core.closure.support.AbstractClosure
          extended by org.springframework.rules.closure.AbstractBinaryClosure
              extended by org.springframework.rules.closure.Maximum
All Implemented Interfaces:
Serializable, Closure, BinaryClosure

public class Maximum
extends AbstractBinaryClosure

Returns the maximum of two Comparable objects; with nulls regarded a being less than non null.

Author:
Keith Donald
See Also:
Serialized Form

Constructor Summary
Maximum()
           
 
Method Summary
 Object call(Object comparable1, Object comparable2)
          Return the maximum of the two Comparable objects.
static BinaryClosure instance()
          Returns the shared instance--this is possible as the default functor for this class is immutable and stateless.
 String toString()
           
 
Methods inherited from class org.springframework.rules.closure.AbstractBinaryClosure
call
 
Methods inherited from class org.springframework.core.closure.support.AbstractClosure
forEach, forEach
 
Methods inherited from class org.springframework.core.closure.support.AlgorithmsAccessor
allTrue, allTrue, anyTrue, anyTrue, findAll, findAll, findFirst, findFirst, forEach, forEach, getAlgorithms
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Maximum

public Maximum()
Method Detail

instance

public static final BinaryClosure instance()
Returns the shared instance--this is possible as the default functor for this class is immutable and stateless.

Returns:
the shared instance

call

public Object call(Object comparable1,
                   Object comparable2)
Return the maximum of the two Comparable objects.

Parameters:
comparable1 - the first comparable
comparable2 - the second comparable
Returns:
the maximum

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.