|
|||||||||
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.Iterator<? extends T>,java.lang.Long> net.sf.jga.fn.algorithm.Count<T>
Summarize
public class Count<T>
Counts values in an iteration.
Copyright © 2003-2005 David A. Hall
Nested Class Summary | |
---|---|
static interface |
Count.Visitor
Deprecated. Interface for classes that may interpret an Count functor. |
Constructor Summary | |
---|---|
Count(Equality<T> eq,
T value)
Deprecated. Builds a Count functor that counts instances of a specific value in an iteration, using the given Equality predicate. |
|
Count(T value)
Deprecated. Builds a Count functor that counts instances of a specific value in an iteration, using the value's equals() method. |
|
Count(UnaryFunctor<T,java.lang.Boolean> eq)
Deprecated. Builds a Count functor that counts instances in an iteration for which the given predicate is true |
Method Summary | |
---|---|
void |
accept(Visitor v)
Deprecated. Calls the Visitor's visit(Count) method, if it
implements the nested Visitor interface. |
java.lang.Long |
fn(java.util.Iterator<? extends T> iterator)
Deprecated. Returns the number of elements in the iteration that meet the given criteria. |
UnaryFunctor<T,java.lang.Boolean> |
getComparisonFn()
Deprecated. Returns the predicate used to determine if an element should be counted. |
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 Count(T value)
public Count(Equality<T> eq, T value)
public Count(UnaryFunctor<T,java.lang.Boolean> eq)
Method Detail |
---|
public UnaryFunctor<T,java.lang.Boolean> getComparisonFn()
public java.lang.Long fn(java.util.Iterator<? extends T> iterator)
fn
in class UnaryFunctor<java.util.Iterator<? extends T>,java.lang.Long>
public void accept(Visitor v)
visit(Count)
method, if it
implements the nested Visitor interface.
accept
in interface Visitable
accept
in class Functor<java.lang.Long>
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 |