com.espertech.esper.epl.expression
Interface ExprEvaluatorTypableReturn

All Superinterfaces:
ExprEvaluator
All Known Implementing Classes:
ExprCaseNode, ExprDeclaredEvalBase, ExprDeclaredEvalNoRewrite, ExprDeclaredEvalRewrite, ExprNewNode, ExprSubselectAllSomeAnyNode, ExprSubselectExistsNode, ExprSubselectInNode, ExprSubselectNode, ExprSubselectRowNode

public interface ExprEvaluatorTypableReturn
extends ExprEvaluator

Interface for evaluators that select possible multi-valued results in a single select column, such as subqueries and "new" and case+new combined.

When returning non-null results from {#getRowProperties}, the ExprEvaluator.evaluate(com.espertech.esper.client.EventBean[], boolean, ExprEvaluatorContext) must return an instance of Map (HashMap is fine).

When returning non-null results, the the evaluator must also return either Object[] results or Object[][], each object-array following the same exact order as provided by the map, matching the multi-row flag.


Method Summary
 java.lang.Object[][] evaluateTypableMulti(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context)
           
 java.lang.Object[] evaluateTypableSingle(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context)
           
 java.util.LinkedHashMap<java.lang.String,java.lang.Object> getRowProperties()
          Return null to indicate no row-type result available, or a map of property names and types to indicate a row-type result is available.
 java.lang.Boolean isMultirow()
          Return true for multi-row return, return false for return of single row only
 
Methods inherited from interface com.espertech.esper.epl.expression.ExprEvaluator
evaluate, getType
 

Method Detail

getRowProperties

java.util.LinkedHashMap<java.lang.String,java.lang.Object> getRowProperties()
                                                                            throws ExprValidationException
Return null to indicate no row-type result available, or a map of property names and types to indicate a row-type result is available.

Returns:
map of property names and types or null
Throws:
ExprValidationException - if the expression is invalid

isMultirow

java.lang.Boolean isMultirow()
Return true for multi-row return, return false for return of single row only

Returns:
multi-row flag

evaluateTypableSingle

java.lang.Object[] evaluateTypableSingle(EventBean[] eventsPerStream,
                                         boolean isNewData,
                                         ExprEvaluatorContext context)

evaluateTypableMulti

java.lang.Object[][] evaluateTypableMulti(EventBean[] eventsPerStream,
                                          boolean isNewData,
                                          ExprEvaluatorContext context)

© 2006-2014 EsperTech Inc.
All rights reserved.
Visit us at espertech.com