net.esper.eql.core
Class MethodResolutionServiceImpl

java.lang.Object
  extended by net.esper.eql.core.MethodResolutionServiceImpl
All Implemented Interfaces:
MethodResolutionService

public class MethodResolutionServiceImpl
extends Object
implements MethodResolutionService

Implements method resolution.


Constructor Summary
MethodResolutionServiceImpl(EngineImportService engineImportService)
          Ctor.
 
Method Summary
 AggregationMethod makeAvedevAggregator()
          Makes a new avedev-aggregator.
 AggregationMethod makeAvgAggregator()
          Makes a new avg-aggregator.
 AggregationMethod makeCountAggregator(boolean isIgnoreNull)
          Makes a new count-aggregator.
 AggregationMethod makeDistinctAggregator(AggregationMethod aggregationMethod)
          Makes a new distinct-value-aggregator.
 AggregationMethod makeMedianAggregator()
          Makes a new median-aggregator.
 AggregationMethod makeMinMaxAggregator(MinMaxTypeEnum minMaxTypeEnum, Class targetType)
          Makes a new min-max-aggregator.
 AggregationSupport makePlugInAggregator(String functionName)
          Makes a new plug-in aggregation instance by name.
 AggregationMethod makeStddevAggregator()
          Makes a new stddev-aggregator.
 AggregationMethod makeSumAggregator(Class type)
          Makes a new sum-aggregator.
 AggregationMethod[] newAggregators(AggregationMethod[] prototypes, MultiKeyUntyped groupKey)
          Returns a new set of aggregators given an existing prototype-set of aggregators for a given group key.
 AggregationSupport resolveAggregation(String functionName)
          Returns a plug-in aggregation method for a given configured aggregation function name.
 Method resolveMethod(String classNameAlias, String methodName, Class[] paramTypes)
          Resolves a given class, method and list of parameter types to a static method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodResolutionServiceImpl

public MethodResolutionServiceImpl(EngineImportService engineImportService)
Ctor.

Parameters:
engineImportService - is the engine imports
Method Detail

makePlugInAggregator

public AggregationSupport makePlugInAggregator(String functionName)
Description copied from interface: MethodResolutionService
Makes a new plug-in aggregation instance by name.

Specified by:
makePlugInAggregator in interface MethodResolutionService
Parameters:
functionName - is the plug-in aggregation function name
Returns:
new instance of plug-in aggregation method

resolveMethod

public Method resolveMethod(String classNameAlias,
                            String methodName,
                            Class[] paramTypes)
                     throws EngineImportException
Description copied from interface: MethodResolutionService
Resolves a given class, method and list of parameter types to a static method.

Specified by:
resolveMethod in interface MethodResolutionService
Parameters:
classNameAlias - is the class name to use
methodName - is the method name
paramTypes - is parameter types match expression sub-nodes
Returns:
method this resolves to
Throws:
EngineImportException - if the method cannot be resolved to a visible static method

makeCountAggregator

public AggregationMethod makeCountAggregator(boolean isIgnoreNull)
Description copied from interface: MethodResolutionService
Makes a new count-aggregator.

Specified by:
makeCountAggregator in interface MethodResolutionService
Parameters:
isIgnoreNull - is true to ignore nulls, or false to count nulls
Returns:
aggregator

resolveAggregation

public AggregationSupport resolveAggregation(String functionName)
                                      throws EngineImportUndefinedException,
                                             EngineImportException
Description copied from interface: MethodResolutionService
Returns a plug-in aggregation method for a given configured aggregation function name.

Specified by:
resolveAggregation in interface MethodResolutionService
Parameters:
functionName - is the aggregation function name
Returns:
aggregation-providing class
Throws:
EngineImportUndefinedException - is the function name cannot be found
EngineImportException - if there was an error resolving class information

makeSumAggregator

public AggregationMethod makeSumAggregator(Class type)
Description copied from interface: MethodResolutionService
Makes a new sum-aggregator.

Specified by:
makeSumAggregator in interface MethodResolutionService
Parameters:
type - is the type to be summed up, i.e. float, long etc.
Returns:
aggregator

makeDistinctAggregator

public AggregationMethod makeDistinctAggregator(AggregationMethod aggregationMethod)
Description copied from interface: MethodResolutionService
Makes a new distinct-value-aggregator.

Specified by:
makeDistinctAggregator in interface MethodResolutionService
Parameters:
aggregationMethod - is the inner aggregation method
Returns:
aggregator

makeAvgAggregator

public AggregationMethod makeAvgAggregator()
Description copied from interface: MethodResolutionService
Makes a new avg-aggregator.

Specified by:
makeAvgAggregator in interface MethodResolutionService
Returns:
aggregator

makeAvedevAggregator

public AggregationMethod makeAvedevAggregator()
Description copied from interface: MethodResolutionService
Makes a new avedev-aggregator.

Specified by:
makeAvedevAggregator in interface MethodResolutionService
Returns:
aggregator

makeMedianAggregator

public AggregationMethod makeMedianAggregator()
Description copied from interface: MethodResolutionService
Makes a new median-aggregator.

Specified by:
makeMedianAggregator in interface MethodResolutionService
Returns:
aggregator

makeMinMaxAggregator

public AggregationMethod makeMinMaxAggregator(MinMaxTypeEnum minMaxTypeEnum,
                                              Class targetType)
Description copied from interface: MethodResolutionService
Makes a new min-max-aggregator.

Specified by:
makeMinMaxAggregator in interface MethodResolutionService
Parameters:
minMaxTypeEnum - dedicates whether to do min or max
targetType - is the type to max or min
Returns:
aggregator

makeStddevAggregator

public AggregationMethod makeStddevAggregator()
Description copied from interface: MethodResolutionService
Makes a new stddev-aggregator.

Specified by:
makeStddevAggregator in interface MethodResolutionService
Returns:
aggregator

newAggregators

public AggregationMethod[] newAggregators(AggregationMethod[] prototypes,
                                          MultiKeyUntyped groupKey)
Description copied from interface: MethodResolutionService
Returns a new set of aggregators given an existing prototype-set of aggregators for a given group key.

Specified by:
newAggregators in interface MethodResolutionService
Parameters:
prototypes - is the prototypes
groupKey - is the key to group-by for
Returns:
new set of aggregators for this group