List of usage examples for org.apache.commons.functor.aggregator AbstractNoStoreAggregator AbstractNoStoreAggregator
public AbstractNoStoreAggregator(BinaryFunction<T, T, T> aggregationFunction)
From source file:org.apache.commons.functor.example.aggregator.nostore.AggregatedFunctionSample.java
/** * Uses a custom function together with a nostore aggregator to provide a * continuous logical OR in between all the values added to the aggregator. *//* ww w . j a v a 2s. c o m*/ public void useOwnFunction() throws Exception { AbstractNoStoreAggregator<Boolean> or = new AbstractNoStoreAggregator<Boolean>(new OwnBinaryFunction()) { @Override protected Boolean initialValue() { return false; } }; or.add(false); System.out.println("OR : " + or.evaluate()); or.add(true); System.out.println("OR : " + or.evaluate()); or.add(false); System.out.println("OR : " + or.evaluate()); }