net.esper.eql.expression
Class ExprMinMaxAggrNode

java.lang.Object
  extended by net.esper.eql.expression.ExprNode
      extended by net.esper.eql.expression.ExprAggregateNode
          extended by net.esper.eql.expression.ExprMinMaxAggrNode
All Implemented Interfaces:
ExprEvaluator, ExprValidator

public class ExprMinMaxAggrNode
extends ExprAggregateNode

Represents the min/max(distinct? ...) aggregate function is an expression tree.


Nested Class Summary
static class ExprMinMaxAggrNode.MinMaxAggregator
          Min/max aggregator for all values.
 
Field Summary
 
Fields inherited from class net.esper.eql.expression.ExprAggregateNode
isDistinct
 
Constructor Summary
ExprMinMaxAggrNode(boolean distinct, MinMaxTypeEnum minMaxTypeEnum)
          Ctor.
 
Method Summary
 boolean equalsNodeAggregate(ExprAggregateNode node)
          Return true if a expression aggregate node semantically equals the current node, or false if not.
 Aggregator getAggregationFunction()
          Returns the aggregation state prototype for use in grouping aggregation states per group-by keys.
protected  java.lang.String getAggregationFunctionName()
          Returns the aggregation function name for representation in a generate expression string.
 java.lang.Class getType()
          Returns the type that the node's evaluate method returns an instance of.
 void validate(StreamTypeService streamTypeService, AutoImportService autoImportService)
          Validate node.
 
Methods inherited from class net.esper.eql.expression.ExprAggregateNode
equalsNode, evaluate, getAggregatesBottomUp, getPrototypeAggregator, isDistinct, setAggregationResultFuture, toExpressionString, validateSingleNumericChild
 
Methods inherited from class net.esper.eql.expression.ExprNode
accept, addChildNode, deepEquals, dumpDebug, getChildNodes, getValidatedSubtree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExprMinMaxAggrNode

public ExprMinMaxAggrNode(boolean distinct,
                          MinMaxTypeEnum minMaxTypeEnum)
Ctor.

Parameters:
distinct - - indicator whether distinct values of all values min/max
minMaxTypeEnum - - enum for whether to minimum or maximum compute
Method Detail

validate

public void validate(StreamTypeService streamTypeService,
                     AutoImportService autoImportService)
              throws ExprValidationException
Description copied from interface: ExprValidator
Validate node.

Parameters:
streamTypeService - serves stream event type info
autoImportService - - for resolving class names in library method invocations
Throws:
ExprValidationException - thrown when validation failed

getAggregationFunction

public Aggregator getAggregationFunction()
Description copied from class: ExprAggregateNode
Returns the aggregation state prototype for use in grouping aggregation states per group-by keys.

Specified by:
getAggregationFunction in class ExprAggregateNode
Returns:
prototype aggregation state as a factory for aggregation states per group-by key value

getType

public java.lang.Class getType()
                        throws ExprValidationException
Description copied from interface: ExprValidator
Returns the type that the node's evaluate method returns an instance of.

Returns:
type returned when evaluated
Throws:
ExprValidationException - thrown when validation failed

equalsNodeAggregate

public final boolean equalsNodeAggregate(ExprAggregateNode node)
Description copied from class: ExprAggregateNode
Return true if a expression aggregate node semantically equals the current node, or false if not.

For use by the equalsNode implementation which compares the distinct flag.

Specified by:
equalsNodeAggregate in class ExprAggregateNode
Parameters:
node - to compare to
Returns:
true if semantically equal, or false if not equals

getAggregationFunctionName

protected java.lang.String getAggregationFunctionName()
Description copied from class: ExprAggregateNode
Returns the aggregation function name for representation in a generate expression string.

Specified by:
getAggregationFunctionName in class ExprAggregateNode
Returns:
aggregation function name