net.sf.jga.fn.algorithm
Class MaxValue<T>

java.lang.Object
  extended by net.sf.jga.fn.Functor<R>
      extended by net.sf.jga.fn.UnaryFunctor<java.util.Collection<? extends T>,T>
          extended by net.sf.jga.fn.algorithm.MaxValue<T>
All Implemented Interfaces:
java.io.Serializable, Visitable

Deprecated. This functionality is moved into Summarize

public class MaxValue<T>
extends UnaryFunctor<java.util.Collection<? extends T>,T>

Identifies the largest value in a collection.

To serialize a MaxValue, the comparator passed at construction must be Serializable.

Copyright © 2003-2005 David A. Hall

Author:
David A. Hall
See Also:
Serialized Form

Nested Class Summary
static interface MaxValue.Visitor
          Deprecated. Interface for classes that may interpret an MaxValue functor.
 
Constructor Summary
MaxValue(java.util.Comparator<T> comp)
          Deprecated. Builds a MaxValue functor that will use the given comparator to compare elements in the collection.
 
Method Summary
 void accept(Visitor v)
          Deprecated. Calls the Visitor's visit(MaxValue) method, if it implements the nested Visitor interface.
 T fn(java.util.Collection<? extends T> collection)
          Deprecated. Returns the largest value in the collection
 java.util.Comparator<T> getComparator()
          Deprecated. Returns the comparator used to order values in the collection.
 java.lang.String toString()
          Deprecated.  
 
Methods inherited from class net.sf.jga.fn.UnaryFunctor
bind, bind0th, bindNth, compose, compose, compose, composeNth, composeNth, eval, generate, generateNth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MaxValue

public MaxValue(java.util.Comparator<T> comp)
Deprecated. 
Builds a MaxValue functor that will use the given comparator to compare elements in the collection. Typically, the functor would compare its two arguments and return the greater value.

Throws:
java.lang.IllegalArgumentException - if the Comparator is null
Method Detail

getComparator

public java.util.Comparator<T> getComparator()
Deprecated. 
Returns the comparator used to order values in the collection.


fn

public T fn(java.util.Collection<? extends T> collection)
Deprecated. 
Returns the largest value in the collection

Specified by:
fn in class UnaryFunctor<java.util.Collection<? extends T>,T>
Throws:
NoSuchElementException - if the collection is empty

accept

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

Specified by:
accept in interface Visitable
Overrides:
accept in class Functor<T>

toString

public java.lang.String toString()
Deprecated. 
Overrides:
toString in class java.lang.Object


Copyright © 2002-2006 David A. Hall. All Rights Reserved.