ehcache

net.sf.ehcache.search.aggregator
Class Count

java.lang.Object
  extended by net.sf.ehcache.search.aggregator.Count
All Implemented Interfaces:
AggregatorInstance<Integer>

public class Count
extends Object
implements AggregatorInstance<Integer>

Counts the number of results

Author:
Greg Luck

Constructor Summary
Count()
           
 
Method Summary
 void accept(Object input)
          Add the given value to the aggregator function
 Integer aggregateResult()
          Retrieve the final result
 Count createClone()
          Create a clone of this aggregator, detaching from its result
 Attribute<?> getAttribute()
          Get the attribute to pass to aggregator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Count

public Count()
Method Detail

createClone

public Count createClone()
Create a clone of this aggregator, detaching from its result

Specified by:
createClone in interface AggregatorInstance<Integer>
Returns:

accept

public void accept(Object input)
            throws AggregatorException
Add the given value to the aggregator function

Specified by:
accept in interface AggregatorInstance<Integer>
Parameters:
input - a single input value
Throws:
AggregatorException - if the function cannot be computed, possibly due to unsupported types

aggregateResult

public Integer aggregateResult()
Retrieve the final result

Specified by:
aggregateResult in interface AggregatorInstance<Integer>
Returns:
aggregate result

getAttribute

public Attribute<?> getAttribute()
Get the attribute to pass to aggregator

Specified by:
getAttribute in interface AggregatorInstance<Integer>
Returns:
attribute to aggregate (null if no attribute is applicable to function)

ehcache

Copyright 2001-2016, Terracotta, Inc.