ehcache

net.sf.ehcache.search.aggregator
Interface AggregatorInstance<T>

Type Parameters:
T - the runtime type of aggregation result
All Known Implementing Classes:
Average, Count, Max, Min, Sum

public interface AggregatorInstance<T>

An AggregatorInstance takes input objects and computes an aggregate function from them.

Author:
Greg Luck

Method Summary
 void accept(Object input)
          Add the given value to the aggregator function
 Object aggregateResult()
          Retrieve the final result
 AggregatorInstance<T> createClone()
          Create a clone of this aggregator, detaching from its result
 Attribute<?> getAttribute()
          Get the attribute to pass to aggregator
 

Method Detail

accept

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

Parameters:
input - a single input value
Throws:
AggregatorException - if the function cannot be computed, possibly due to unsupported types

aggregateResult

Object aggregateResult()
Retrieve the final result

Returns:
aggregate result

getAttribute

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

Returns:
attribute to aggregate (null if no attribute is applicable to function)

createClone

AggregatorInstance<T> createClone()
Create a clone of this aggregator, detaching from its result

Returns:

ehcache

Copyright 2001-2015, Terracotta, Inc.