net.sf.jga.fn.algorithm
Class MinValue<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.MinValue<T>
All Implemented Interfaces:
java.io.Serializable, Visitable

Deprecated. This functionality is moved into Summarize

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

Identifies the smallest value in a collection.

To serialize a MinValue, 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 MinValue.Visitor
          Deprecated. Interface for classes that may interpret an MinValue functor.
 
Constructor Summary
MinValue(java.util.Comparator<T> comp)
          Deprecated. Builds a MinValue 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(MinValue) method, if it implements the nested Visitor interface.
 T fn(java.util.Collection<? extends T> collection)
          Deprecated. Return the smallest value in the collection
 java.util.Comparator<T> getComparator()
          Deprecated. Returns the functor 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

MinValue

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

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

getComparator

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


fn

public T fn(java.util.Collection<? extends T> collection)
Deprecated. 
Return the smallest 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(MinValue) 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.