本文整理匯總了Java中com.espertech.esper.event.vaevent.VariantEvent類的典型用法代碼示例。如果您正苦於以下問題:Java VariantEvent類的具體用法?Java VariantEvent怎麽用?Java VariantEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
VariantEvent類屬於com.espertech.esper.event.vaevent包,在下文中一共展示了VariantEvent類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: evaluateCodegen
import com.espertech.esper.event.vaevent.VariantEvent; //導入依賴的package包/類
public CodegenExpression evaluateCodegen(Class requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) {
CodegenMethodNode methodNode = codegenMethodScope.makeChild(String.class, ExprTypeofNodeForgeStreamEvent.class, codegenClassScope);
CodegenExpressionRef refEPS = exprSymbol.getAddEPS(methodNode);
methodNode.getBlock()
.declareVar(EventBean.class, "event", arrayAtIndex(refEPS, constant(streamNum)))
.ifRefNullReturnNull("event")
.ifInstanceOf("event", VariantEvent.class)
.blockReturn(exprDotMethodChain(cast(VariantEvent.class, ref("event"))).add("getUnderlyingEventBean").add("getEventType").add("getName"))
.methodReturn(exprDotMethodChain(ref("event")).add("getEventType").add("getName"));
return localMethod(methodNode);
}
示例2: evaluate
import com.espertech.esper.event.vaevent.VariantEvent; //導入依賴的package包/類
@Override
public Object evaluate(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context) {
EventBean theEvent = eventsPerStream[streamNum];
if (theEvent == null) {
return null;
}
if (theEvent instanceof VariantEvent) {
return ((VariantEvent) theEvent).getUnderlyingEventBean().getEventType().getName();
}
return theEvent.getEventType().getName();
}