for (int i = 0; i < typesPerStream.length; i++)
{
final int streamNum = i;
final Class returnType = typesPerStream[streamNum].getUnderlyingType();
expressions.add(new ExprEvaluator() {
public Object evaluate(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
{
EventBean event = eventsPerStream[streamNum];
if (event != null)
{
return event.getUnderlying();
}
else
{
return null;
}
}
public Class getType()
{
return returnType;
}
public Map<String, Object> getEventType() {
return null;
}
});
types.add(returnType);
columnNames.add(streamNames[streamNum]);
}
}
// handle stream wildcards by outputting the stream underlying event
else if (element instanceof SelectClauseStreamCompiledSpec)
{
final SelectClauseStreamCompiledSpec streamSpec = (SelectClauseStreamCompiledSpec) element;
final Class returnType = typesPerStream[streamSpec.getStreamNumber()].getUnderlyingType();
expressions.add(new ExprEvaluator() {
public Object evaluate(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
{
EventBean event = eventsPerStream[streamSpec.getStreamNumber()];
if (event != null)
{
return event.getUnderlying();
}
else
{
return null;
}
}
public Class getType()
{
return returnType;
}
public Map<String, Object> getEventType() {
return null;
}
});
types.add(returnType);
columnNames.add(streamNames[streamSpec.getStreamNumber()]);
}
// handle expressions
else if (element instanceof SelectClauseExprCompiledSpec)
{
SelectClauseExprCompiledSpec expr = (SelectClauseExprCompiledSpec) element;
ExprEvaluator evaluator = expr.getSelectExpression().getExprEvaluator();
expressions.add(evaluator);
types.add(evaluator.getType());
if (expr.getAssignedName() != null)
{
columnNames.add(expr.getAssignedName());
}
else