本文整理汇总了Java中com.espertech.esper.event.arr.ObjectArrayEventBean类的典型用法代码示例。如果您正苦于以下问题:Java ObjectArrayEventBean类的具体用法?Java ObjectArrayEventBean怎么用?Java ObjectArrayEventBean使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ObjectArrayEventBean类属于com.espertech.esper.event.arr包,在下文中一共展示了ObjectArrayEventBean类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateTable
import com.espertech.esper.event.arr.ObjectArrayEventBean; //导入依赖的package包/类
public void updateTable(Collection<EventBean> eventsUnsafeIter, TableStateInstance instance, EventBean[] eventsPerStream, ExprEvaluatorContext exprEvaluatorContext) {
// update (no-copy unless original values required)
for (EventBean event : eventsUnsafeIter) {
eventsPerStream[0] = event;
ObjectArrayBackedEventBean updatedEvent = (ObjectArrayBackedEventBean) event;
// if "initial.property" is part of the assignment expressions, provide initial value event
if (updateHelper.isRequiresStream2InitialValueEvent()) {
Object[] prev = new Object[updatedEvent.getProperties().length];
System.arraycopy(updatedEvent.getProperties(), 0, prev, 0, prev.length);
eventsPerStream[2] = new ObjectArrayEventBean(prev, updatedEvent.getEventType());
}
// apply in-place updates
updateHelper.updateNoCopy(updatedEvent, eventsPerStream, exprEvaluatorContext);
instance.handleRowUpdated(updatedEvent);
}
}
示例2: evaluateEnumMethod
import com.espertech.esper.event.arr.ObjectArrayEventBean; //导入依赖的package包/类
public Object evaluateEnumMethod(EventBean[] eventsLambda, Collection enumcoll, boolean isNewData, ExprEvaluatorContext context) {
Object result = null;
ObjectArrayEventBean evalEvent = new ObjectArrayEventBean(new Object[1], forge.type);
eventsLambda[forge.streamNumLambda] = evalEvent;
Object[] props = evalEvent.getProperties();
for (Object next : enumcoll) {
props[0] = next;
Object pass = innerExpression.evaluate(eventsLambda, isNewData, context);
if (pass == null || (!(Boolean) pass)) {
continue;
}
result = next;
}
return result;
}
示例3: codegen
import com.espertech.esper.event.arr.ObjectArrayEventBean; //导入依赖的package包/类
public static CodegenExpression codegen(EnumLastOfPredicateScalarForge forge, EnumForgeCodegenParams args, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) {
CodegenMember typeMember = codegenClassScope.makeAddMember(ObjectArrayEventType.class, forge.type);
Class resultType = JavaClassHelper.getBoxedType(EPTypeHelper.getCodegenReturnType(forge.resultType));
ExprForgeCodegenSymbol scope = new ExprForgeCodegenSymbol(false, null);
CodegenMethodNode methodNode = codegenMethodScope.makeChildWithScope(resultType, EnumLastOfPredicateScalarForgeEval.class, scope, codegenClassScope).addParam(EnumForgeCodegenNames.PARAMS);
CodegenBlock block;
block = methodNode.getBlock()
.declareVar(Object.class, "result", constantNull())
.declareVar(ObjectArrayEventBean.class, "evalEvent", newInstance(ObjectArrayEventBean.class, newArrayByLength(Object.class, constant(1)), member(typeMember.getMemberId())))
.assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(forge.streamNumLambda), ref("evalEvent"))
.declareVar(Object[].class, "props", exprDotMethod(ref("evalEvent"), "getProperties"));
CodegenBlock forEach = block.forEach(Object.class, "next", EnumForgeCodegenNames.REF_ENUMCOLL)
.assignArrayElement("props", constant(0), ref("next"));
CodegenLegoBooleanExpression.codegenContinueIfNullOrNotPass(forEach, forge.innerExpression.getEvaluationType(), forge.innerExpression.evaluateCodegen(Boolean.class, methodNode, scope, codegenClassScope));
forEach.assignRef("result", ref("next"));
block.methodReturn(cast(resultType, ref("result")));
return localMethod(methodNode, args.getEps(), args.getEnumcoll(), args.getIsNewData(), args.getExprCtx());
}
示例4: evaluateEnumMethod
import com.espertech.esper.event.arr.ObjectArrayEventBean; //导入依赖的package包/类
public Object evaluateEnumMethod(EventBean[] eventsLambda, Collection enumcoll, boolean isNewData, ExprEvaluatorContext context) {
if (enumcoll.isEmpty()) {
return true;
}
ObjectArrayEventBean evalEvent = new ObjectArrayEventBean(new Object[1], forge.type);
eventsLambda[forge.streamNumLambda] = evalEvent;
Object[] props = evalEvent.getProperties();
for (Object next : enumcoll) {
props[0] = next;
Object pass = innerExpression.evaluate(eventsLambda, isNewData, context);
if (pass != null && (!(Boolean) pass)) {
return false;
}
}
return true;
}
示例5: codegen
import com.espertech.esper.event.arr.ObjectArrayEventBean; //导入依赖的package包/类
public static CodegenExpression codegen(EnumAllOfScalarForge forge, EnumForgeCodegenParams args, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) {
CodegenMember typeMember = codegenClassScope.makeAddMember(ObjectArrayEventType.class, forge.type);
ExprForgeCodegenSymbol scope = new ExprForgeCodegenSymbol(false, null);
CodegenMethodNode methodNode = codegenMethodScope.makeChildWithScope(boolean.class, EnumAllOfScalarForgeEval.class, scope, codegenClassScope).addParam(EnumForgeCodegenNames.PARAMS);
CodegenBlock block = methodNode.getBlock();
block.ifConditionReturnConst(exprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "isEmpty"), true);
block.declareVar(ObjectArrayEventBean.class, "evalEvent", newInstance(ObjectArrayEventBean.class, newArrayByLength(Object.class, constant(1)), member(typeMember.getMemberId())))
.assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(forge.streamNumLambda), ref("evalEvent"))
.declareVar(Object[].class, "props", exprDotMethod(ref("evalEvent"), "getProperties"));
CodegenBlock forEach = block.forEach(Object.class, "next", EnumForgeCodegenNames.REF_ENUMCOLL)
.assignArrayElement("props", constant(0), ref("next"));
CodegenLegoBooleanExpression.codegenReturnBoolIfNullOrBool(forEach, forge.innerExpression.getEvaluationType(), forge.innerExpression.evaluateCodegen(Boolean.class, methodNode, scope, codegenClassScope), false, null, false, false);
block.methodReturn(constantTrue());
return localMethod(methodNode, args.getEps(), args.getEnumcoll(), args.getIsNewData(), args.getExprCtx());
}
示例6: codegen
import com.espertech.esper.event.arr.ObjectArrayEventBean; //导入依赖的package包/类
public static CodegenExpression codegen(EnumGroupByKeySelectorScalarLambdaForge forge, EnumForgeCodegenParams args, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) {
CodegenMember resultTypeMember = codegenClassScope.makeAddMember(ObjectArrayEventType.class, forge.resultEventType);
ExprForgeCodegenSymbol scope = new ExprForgeCodegenSymbol(false, null);
CodegenMethodNode methodNode = codegenMethodScope.makeChildWithScope(Map.class, EnumGroupByKeySelectorScalarLambdaForgeEval.class, scope, codegenClassScope).addParam(EnumForgeCodegenNames.PARAMS);
CodegenBlock block = methodNode.getBlock()
.ifCondition(exprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "isEmpty"))
.blockReturn(staticMethod(Collections.class, "emptyMap"))
.declareVar(Map.class, "result", newInstance(LinkedHashMap.class))
.declareVar(ObjectArrayEventBean.class, "resultEvent", newInstance(ObjectArrayEventBean.class, newArrayByLength(Object.class, constant(1)), CodegenExpressionBuilder.member(resultTypeMember.getMemberId())))
.assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(forge.streamNumLambda), ref("resultEvent"))
.declareVar(Object[].class, "props", exprDotMethod(ref("resultEvent"), "getProperties"));
CodegenBlock forEach = block.forEach(Object.class, "next", EnumForgeCodegenNames.REF_ENUMCOLL)
.assignArrayElement("props", constant(0), ref("next"))
.declareVar(Object.class, "key", forge.innerExpression.evaluateCodegen(Object.class, methodNode, scope, codegenClassScope))
.declareVar(Collection.class, "value", cast(Collection.class, exprDotMethod(ref("result"), "get", ref("key"))))
.ifRefNull("value")
.assignRef("value", newInstance(ArrayList.class))
.expression(exprDotMethod(ref("result"), "put", ref("key"), ref("value")))
.blockEnd()
.expression(exprDotMethod(ref("value"), "add", ref("next")));
block.methodReturn(ref("result"));
return localMethod(methodNode, args.getEps(), args.getEnumcoll(), args.getIsNewData(), args.getExprCtx());
}
示例7: evaluateEnumMethod
import com.espertech.esper.event.arr.ObjectArrayEventBean; //导入依赖的package包/类
public Object evaluateEnumMethod(EventBean[] eventsLambda, Collection enumcoll, boolean isNewData, ExprEvaluatorContext context) {
if (enumcoll.isEmpty()) {
return false;
}
ObjectArrayEventBean evalEvent = new ObjectArrayEventBean(new Object[1], forge.type);
eventsLambda[forge.streamNumLambda] = evalEvent;
Object[] props = evalEvent.getProperties();
for (Object next : enumcoll) {
props[0] = next;
Object pass = innerExpression.evaluate(eventsLambda, isNewData, context);
if (pass != null && ((Boolean) pass)) {
return true;
}
}
return false;
}
示例8: codegen
import com.espertech.esper.event.arr.ObjectArrayEventBean; //导入依赖的package包/类
public static CodegenExpression codegen(EnumAnyOfScalarForge forge, EnumForgeCodegenParams args, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) {
CodegenMember typeMember = codegenClassScope.makeAddMember(ObjectArrayEventType.class, forge.type);
ExprForgeCodegenSymbol scope = new ExprForgeCodegenSymbol(false, null);
CodegenMethodNode methodNode = codegenMethodScope.makeChildWithScope(boolean.class, EnumAllOfScalarForgeEval.class, scope, codegenClassScope).addParam(EnumForgeCodegenNames.PARAMS);
CodegenBlock block = methodNode.getBlock()
.ifConditionReturnConst(exprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "isEmpty"), false)
.declareVar(ObjectArrayEventBean.class, "evalEvent", newInstance(ObjectArrayEventBean.class, newArrayByLength(Object.class, constant(1)), member(typeMember.getMemberId())));
block.assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(forge.streamNumLambda), ref("evalEvent"))
.declareVar(Object[].class, "props", exprDotMethod(ref("evalEvent"), "getProperties"));
CodegenBlock forEach = block.forEach(Object.class, "next", EnumForgeCodegenNames.REF_ENUMCOLL)
.assignArrayElement("props", constant(0), ref("next"));
CodegenLegoBooleanExpression.codegenReturnBoolIfNullOrBool(forEach, forge.innerExpression.getEvaluationType(), forge.innerExpression.evaluateCodegen(Boolean.class, methodNode, scope, codegenClassScope), false, null, true, true);
block.methodReturn(constantFalse());
return localMethod(methodNode, args.getEps(), args.getEnumcoll(), args.getIsNewData(), args.getExprCtx());
}
示例9: codegen
import com.espertech.esper.event.arr.ObjectArrayEventBean; //导入依赖的package包/类
public static CodegenExpression codegen(EnumWhereIndexEventsForge forge, EnumForgeCodegenParams args, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) {
CodegenMember indexTypeMember = codegenClassScope.makeAddMember(ObjectArrayEventType.class, forge.indexEventType);
ExprForgeCodegenSymbol scope = new ExprForgeCodegenSymbol(false, null);
CodegenMethodNode methodNode = codegenMethodScope.makeChildWithScope(Collection.class, EnumWhereIndexEventsForgeEval.class, scope, codegenClassScope).addParam(EnumForgeCodegenNames.PARAMS);
CodegenBlock block = methodNode.getBlock()
.ifCondition(exprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "isEmpty"))
.blockReturn(EnumForgeCodegenNames.REF_ENUMCOLL);
block.declareVar(ArrayDeque.class, "result", newInstance(ArrayDeque.class))
.declareVar(ObjectArrayEventBean.class, "indexEvent", newInstance(ObjectArrayEventBean.class, newArrayByLength(Object.class, constant(1)), member(indexTypeMember.getMemberId())))
.assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(forge.streamNumLambda + 1), ref("indexEvent"))
.declareVar(Object[].class, "props", exprDotMethod(ref("indexEvent"), "getProperties"))
.declareVar(int.class, "count", constant(-1));
CodegenBlock forEach = block.forEach(EventBean.class, "next", EnumForgeCodegenNames.REF_ENUMCOLL)
.increment("count")
.assignArrayElement("props", constant(0), ref("count"))
.assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(forge.streamNumLambda), ref("next"));
CodegenLegoBooleanExpression.codegenContinueIfNullOrNotPass(forEach, forge.innerExpression.getEvaluationType(), forge.innerExpression.evaluateCodegen(Boolean.class, methodNode, scope, codegenClassScope));
forEach.expression(exprDotMethod(ref("result"), "add", ref("next")));
block.methodReturn(ref("result"));
return localMethod(methodNode, args.getEps(), args.getEnumcoll(), args.getIsNewData(), args.getExprCtx());
}
示例10: codegen
import com.espertech.esper.event.arr.ObjectArrayEventBean; //导入依赖的package包/类
public static CodegenExpression codegen(EnumGroupByKeyValueSelectorScalarLambdaForge forge, EnumForgeCodegenParams args, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) {
CodegenMember resultTypeMember = codegenClassScope.makeAddMember(ObjectArrayEventType.class, forge.resultEventType);
ExprForgeCodegenSymbol scope = new ExprForgeCodegenSymbol(false, null);
CodegenMethodNode methodNode = codegenMethodScope.makeChildWithScope(Map.class, EnumGroupByKeyValueSelectorScalarLambdaForgeEval.class, scope, codegenClassScope).addParam(EnumForgeCodegenNames.PARAMS);
CodegenBlock block = methodNode.getBlock()
.ifCondition(exprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "isEmpty"))
.blockReturn(staticMethod(Collections.class, "emptyMap"))
.declareVar(Map.class, "result", newInstance(LinkedHashMap.class))
.declareVar(ObjectArrayEventBean.class, "resultEvent", newInstance(ObjectArrayEventBean.class, newArrayByLength(Object.class, constant(1)), member(resultTypeMember.getMemberId())))
.assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(forge.streamNumLambda), ref("resultEvent"))
.declareVar(Object[].class, "props", exprDotMethod(ref("resultEvent"), "getProperties"));
block.forEach(Object.class, "next", EnumForgeCodegenNames.REF_ENUMCOLL)
.assignArrayElement("props", constant(0), ref("next"))
.declareVar(Object.class, "key", forge.innerExpression.evaluateCodegen(Object.class, methodNode, scope, codegenClassScope))
.declareVar(Object.class, "entry", forge.secondExpression.evaluateCodegen(Object.class, methodNode, scope, codegenClassScope))
.declareVar(Collection.class, "value", cast(Collection.class, exprDotMethod(ref("result"), "get", ref("key"))))
.ifRefNull("value")
.assignRef("value", newInstance(ArrayList.class))
.expression(exprDotMethod(ref("result"), "put", ref("key"), ref("value")))
.blockEnd()
.expression(exprDotMethod(ref("value"), "add", ref("entry")));
block.methodReturn(ref("result"));
return localMethod(methodNode, args.getEps(), args.getEnumcoll(), args.getIsNewData(), args.getExprCtx());
}
示例11: evaluateEnumMethod
import com.espertech.esper.event.arr.ObjectArrayEventBean; //导入依赖的package包/类
public Object evaluateEnumMethod(EventBean[] eventsLambda, Collection enumcoll, boolean isNewData, ExprEvaluatorContext context) {
Object value = initialization.evaluate(eventsLambda, isNewData, context);
if (enumcoll.isEmpty()) {
return value;
}
ObjectArrayEventBean resultEvent = new ObjectArrayEventBean(new Object[1], forge.resultEventType);
ObjectArrayEventBean evalEvent = new ObjectArrayEventBean(new Object[1], forge.getEvalEventType());
eventsLambda[forge.streamNumLambda] = resultEvent;
eventsLambda[forge.streamNumLambda + 1] = evalEvent;
Object[] resultProps = resultEvent.getProperties();
Object[] evalProps = evalEvent.getProperties();
for (Object next : enumcoll) {
resultProps[0] = value;
evalProps[0] = next;
value = innerExpression.evaluate(eventsLambda, isNewData, context);
}
return value;
}
示例12: evaluateEnumMethod
import com.espertech.esper.event.arr.ObjectArrayEventBean; //导入依赖的package包/类
public Object evaluateEnumMethod(EventBean[] eventsLambda, Collection enumcoll, boolean isNewData, ExprEvaluatorContext context) {
ExprDotEvalSumMethod method = forge.sumMethodFactory.getSumAggregator();
ObjectArrayEventBean resultEvent = new ObjectArrayEventBean(new Object[1], forge.resultEventType);
eventsLambda[forge.streamNumLambda] = resultEvent;
Object[] props = resultEvent.getProperties();
Collection<Object> values = (Collection<Object>) enumcoll;
for (Object next : values) {
props[0] = next;
Object value = innerExpression.evaluate(eventsLambda, isNewData, context);
method.enter(value);
}
return method.getValue();
}
示例13: codegen
import com.espertech.esper.event.arr.ObjectArrayEventBean; //导入依赖的package包/类
public static CodegenExpression codegen(EnumSumScalarLambdaForge forge, EnumForgeCodegenParams args, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) {
Class innerType = forge.innerExpression.getEvaluationType();
CodegenMember resultTypeMember = codegenClassScope.makeAddMember(ObjectArrayEventType.class, forge.resultEventType);
ExprForgeCodegenSymbol scope = new ExprForgeCodegenSymbol(false, null);
CodegenMethodNode methodNode = codegenMethodScope.makeChildWithScope(forge.sumMethodFactory.getValueType(), EnumSumEventsForgeEval.class, scope, codegenClassScope).addParam(EnumForgeCodegenNames.PARAMS);
CodegenBlock block = methodNode.getBlock();
forge.sumMethodFactory.codegenDeclare(block);
block.declareVar(ObjectArrayEventBean.class, "resultEvent", newInstance(ObjectArrayEventBean.class, newArrayByLength(Object.class, constant(1)), member(resultTypeMember.getMemberId())))
.assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(forge.streamNumLambda), ref("resultEvent"))
.declareVar(Object[].class, "props", exprDotMethod(ref("resultEvent"), "getProperties"));
CodegenBlock forEach = block.forEach(Object.class, "next", EnumForgeCodegenNames.REF_ENUMCOLL)
.assignArrayElement("props", constant(0), ref("next"))
.declareVar(innerType, "value", forge.innerExpression.evaluateCodegen(innerType, methodNode, scope, codegenClassScope));
if (!innerType.isPrimitive()) {
forEach.ifRefNull("value").blockContinue();
}
forge.sumMethodFactory.codegenEnterNumberTypedNonNull(forEach, ref("value"));
forge.sumMethodFactory.codegenReturn(block);
return localMethod(methodNode, args.getEps(), args.getEnumcoll(), args.getIsNewData(), args.getExprCtx());
}
示例14: evaluateEnumMethod
import com.espertech.esper.event.arr.ObjectArrayEventBean; //导入依赖的package包/类
public Object evaluateEnumMethod(EventBean[] eventsLambda, Collection enumcoll, boolean isNewData, ExprEvaluatorContext context) {
int count = 0;
ObjectArrayEventBean evalEvent = new ObjectArrayEventBean(new Object[1], forge.type);
eventsLambda[forge.streamNumLambda] = evalEvent;
Object[] props = evalEvent.getProperties();
for (Object next : enumcoll) {
props[0] = next;
Object pass = innerExpression.evaluate(eventsLambda, isNewData, context);
if (pass == null || (!(Boolean) pass)) {
continue;
}
count++;
}
return count;
}
示例15: codegen
import com.espertech.esper.event.arr.ObjectArrayEventBean; //导入依赖的package包/类
public static CodegenExpression codegen(EnumCountOfSelectorScalarForge forge, EnumForgeCodegenParams args, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) {
CodegenMember typeMember = codegenClassScope.makeAddMember(ObjectArrayEventType.class, forge.type);
ExprForgeCodegenSymbol scope = new ExprForgeCodegenSymbol(false, null);
CodegenMethodNode methodNode = codegenMethodScope.makeChildWithScope(int.class, EnumCountOfSelectorScalarForgeEval.class, scope, codegenClassScope).addParam(EnumForgeCodegenNames.PARAMS);
CodegenBlock block = methodNode.getBlock()
.declareVar(int.class, "count", constant(0))
.declareVar(ObjectArrayEventBean.class, "evalEvent", newInstance(ObjectArrayEventBean.class, newArrayByLength(Object.class, constant(1)), member(typeMember.getMemberId())))
.assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(forge.streamNumLambda), ref("evalEvent"))
.declareVar(Object[].class, "props", exprDotMethod(ref("evalEvent"), "getProperties"));
CodegenBlock forEach = block.forEach(Object.class, "next", EnumForgeCodegenNames.REF_ENUMCOLL)
.assignArrayElement(ref("props"), constant(0), ref("next"));
CodegenLegoBooleanExpression.codegenContinueIfNullOrNotPass(forEach, forge.innerExpression.getEvaluationType(), forge.innerExpression.evaluateCodegen(Boolean.class, methodNode, scope, codegenClassScope));
forEach.increment("count");
block.methodReturn(ref("count"));
return localMethod(methodNode, args.getEps(), args.getEnumcoll(), args.getIsNewData(), args.getExprCtx());
}