public final class IntegerCountAggregatorBinaryFunction extends Object implements BinaryFunction<Integer,Integer,Integer>
AbstractNoStoreAggregatorwhich simply increments the first argument by 1 and returns it. The reason behind this class is to provide a simple counter implementation: users call
AbstractTimedAggregator.add(Object)with some data (which will be ignored) and the class will simply count how many times this call was made. Such an implementation can be used for instance to keep track for instance of number of transactions going through a system, whereas every time a transaction was made we just increment a counter. This can be achieved still using a
DoubleSumAggregatorBinaryFunction-like function (but using int) and always supplying the second parameter as 1 (one). However, using this might make the code clearer.
|Constructor and Description|
leftby one and returns it.
Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.