Package net.sf.ehcache.search.aggregator
Class Count
- java.lang.Object
-
- net.sf.ehcache.search.aggregator.Count
-
- All Implemented Interfaces:
AggregatorInstance<java.lang.Integer>
public class Count extends java.lang.Object implements AggregatorInstance<java.lang.Integer>
Counts the number of results- Author:
- Greg Luck
-
-
Constructor Summary
Constructors Constructor Description Count()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(java.lang.Object input)Add the given value to the aggregator functionjava.lang.IntegeraggregateResult()Retrieve the final resultCountcreateClone()Create a clone of this aggregator, detaching from its resultAttribute<?>getAttribute()Get the attribute to pass to aggregator
-
-
-
Method Detail
-
createClone
public Count createClone()
Create a clone of this aggregator, detaching from its result- Specified by:
createClonein interfaceAggregatorInstance<java.lang.Integer>- Returns:
-
accept
public void accept(java.lang.Object input) throws AggregatorExceptionAdd the given value to the aggregator function- Specified by:
acceptin interfaceAggregatorInstance<java.lang.Integer>- Parameters:
input- a single input value- Throws:
AggregatorException- if the function cannot be computed, possibly due to unsupported types
-
aggregateResult
public java.lang.Integer aggregateResult()
Retrieve the final result- Specified by:
aggregateResultin interfaceAggregatorInstance<java.lang.Integer>- Returns:
- aggregate result
-
getAttribute
public Attribute<?> getAttribute()
Get the attribute to pass to aggregator- Specified by:
getAttributein interfaceAggregatorInstance<java.lang.Integer>- Returns:
- attribute to aggregate (null if no attribute is applicable to function)
-
-