| net.sf.jga.fn.algorithm.Count
Count | public class Count extends UnaryFunctor,Long> (Code) | | Counts values in an iteration.
Copyright © 2003-2005 David A. Hall
author: David A. Hall |
Constructor Summary | |
public | Count(T value) Builds a Count functor that counts instances of a specific value in an
iteration, using the value's equals() method. | public | Count(Equality<T> eq, T value) Builds a Count functor that counts instances of a specific value in an
iteration, using the given Equality predicate. | public | Count(UnaryFunctor<T, Boolean> eq) |
serialVersionUID | final static long serialVersionUID(Code) | | |
Count | public Count(T value)(Code) | | Builds a Count functor that counts instances of a specific value in an
iteration, using the value's equals() method.
|
Count | public Count(Equality<T> eq, T value)(Code) | | Builds a Count functor that counts instances of a specific value in an
iteration, using the given Equality predicate.
|
Count | public Count(UnaryFunctor<T, Boolean> eq)(Code) | | Builds a Count functor that counts instances in an iteration for which
the given predicate is true
|
accept | public void accept(net.sf.jga.fn.Visitor v)(Code) | | Calls the Visitor's visit(Count) method, if it
implements the nested Visitor interface.
|
fn | public Long fn(Iterator<? extends T> iterator)(Code) | | Returns the number of elements in the iteration that meet the given
criteria.
|
getComparisonFn | public UnaryFunctor<T, Boolean> getComparisonFn()(Code) | | Returns the predicate used to determine if an element should be counted.
|
|
|