|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.jga.fn.Functor<R>
net.sf.jga.fn.UnaryFunctor<java.util.Iterator<T>,T>
net.sf.jga.fn.arithmetic.Average<T>
public class Average<T extends java.lang.Number>
Averages numeric values in an iteration.
Copyright © 2005 David A. Hall
| Nested Class Summary | |
|---|---|
static interface |
Average.Visitor
Interface for classes that may interpret an Average functor. |
| Constructor Summary | |
|---|---|
Average(java.lang.Class<T> type)
Builds a functor that averages numeric values in an iteration |
|
| Method Summary | |
|---|---|
void |
accept(Visitor v)
Calls the Visitor's visit(Average) method, if it
implements the nested Visitor interface. |
T |
fn(java.util.Iterator<T> iterator)
Returns the average of the elements in the iteration |
java.lang.String |
toString()
|
| 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 Average(java.lang.Class<T> type)
| Method Detail |
|---|
public T fn(java.util.Iterator<T> iterator)
fn in class UnaryFunctor<java.util.Iterator<T extends java.lang.Number>,T extends java.lang.Number>public void accept(Visitor v)
visit(Average) method, if it
implements the nested Visitor interface.
accept in interface Visitableaccept in class Functor<T extends java.lang.Number>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 | ||||||||