|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jga.fn.Functor<R> net.sf.jga.fn.UnaryFunctor<java.util.Collection<? extends T>,T> net.sf.jga.fn.algorithm.MaxValue<T>
Summarize
public class MaxValue<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
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 |
---|
public MaxValue(java.util.Comparator<T> comp)
java.lang.IllegalArgumentException
- if the Comparator is nullMethod Detail |
---|
public java.util.Comparator<T> getComparator()
public T fn(java.util.Collection<? extends T> collection)
fn
in class UnaryFunctor<java.util.Collection<? extends T>,T>
NoSuchElementException
- if the collection is emptypublic void accept(Visitor v)
visit(MaxValue)
method, if it
implements the nested Visitor interface.
accept
in interface Visitable
accept
in class Functor<T>
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |