net.esper.eql.expression
Class ExprMedianNode

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

public class ExprMedianNode
extends ExprAggregateNode

Represents the median(...) aggregate function is an expression tree.


Nested Class Summary
static class ExprMedianNode.DoubleMedian
          Average always generates double-types numbers.
 
Field Summary
 
Fields inherited from class net.esper.eql.expression.ExprAggregateNode
isDistinct
 
Constructor Summary
ExprMedianNode(boolean distinct)
          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  String getAggregationFunctionName()
          Returns the aggregation function name for representation in a generate expression string.
 Class getType()
          Returns the type that the node's evaluate method returns an instance of.
 void validate(StreamTypeService streamTypeService, AutoImportService autoImportService, ViewResourceDelegate viewResourceDelegate)
          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

ExprMedianNode

public ExprMedianNode(boolean distinct)
Ctor.

Parameters:
distinct - - flag indicating unique or non-unique value aggregation
Method Detail

validate

public void validate(StreamTypeService streamTypeService,
                     AutoImportService autoImportService,
                     ViewResourceDelegate viewResourceDelegate)
              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
viewResourceDelegate - - delegates for view resources to expression nodes
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

getAggregationFunctionName

protected 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

getType

public 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