Package com.espertech.esper.epl.enummethod.dot

Examples of com.espertech.esper.epl.enummethod.dot.ExprDotEvalParamLambda


    public EnumEval getEnumEval(MethodResolutionService methodResolutionService, EventAdapterService eventAdapterService, StreamTypeService streamTypeService, String statementId, String enumMethodUsedName, List<ExprDotEvalParam> bodiesAndParameters, EventType inputEventType, Class collectionComponentType, int numStreamsIncoming, boolean disablePropertyExpressionEventCollCache) {
        ExprDotEvalParam initValueParam = bodiesAndParameters.get(0);
        ExprEvaluator initValueEval = initValueParam.getBodyEvaluator();
        super.setTypeInfo(ExpressionReturnType.singleValue(JavaClassHelper.getBoxedType(initValueEval.getType())));

        ExprDotEvalParamLambda resultAndAdd = (ExprDotEvalParamLambda) bodiesAndParameters.get(1);

        if (inputEventType != null) {
            return new EnumEvalAggregateEvents(initValueEval,
                    resultAndAdd.getBodyEvaluator(), resultAndAdd.getStreamCountIncoming(),
                    (ObjectArrayEventType) resultAndAdd.getGoesToTypes()[0]);
        }
        else {
            return new EnumEvalAggregateScalar(initValueEval,
                    resultAndAdd.getBodyEvaluator(), resultAndAdd.getStreamCountIncoming(),
                    (ObjectArrayEventType) resultAndAdd.getGoesToTypes()[0],
                    (ObjectArrayEventType) resultAndAdd.getGoesToTypes()[1]);
        }
    }
View Full Code Here


        super.setTypeInfo(ExpressionReturnType.singleValue(Integer.class));
        if (bodiesAndParameters.isEmpty()) {
            return new EnumEvalCountOf(numStreamsIncoming);
        }

        ExprDotEvalParamLambda first = (ExprDotEvalParamLambda) bodiesAndParameters.get(0);
        if (inputEventType != null) {
            return new EnumEvalCountOfSelectorEvents(first.getBodyEvaluator(), first.getStreamCountIncoming());
        }
        else {
            return new EnumEvalCountOfSelectorScalar(first.getBodyEvaluator(), first.getStreamCountIncoming(), (ObjectArrayEventType) first.getGoesToTypes()[0]);
        }
    }
View Full Code Here

            }
            super.setTypeInfo(ExpressionReturnType.singleValue(Double.class));
            return new EnumEvalAverageScalar(numStreamsIncoming);
        }

        ExprDotEvalParamLambda first = (ExprDotEvalParamLambda) bodiesAndParameters.get(0);
        Class returnType = first.getBodyEvaluator().getType();

        if (returnType == BigDecimal.class || returnType == BigInteger.class) {
            super.setTypeInfo(ExpressionReturnType.singleValue(BigDecimal.class));
            if (inputEventType == null) {
                return new EnumEvalAverageBigDecimalScalarLambda(first.getBodyEvaluator(), first.getStreamCountIncoming(),
                        (ObjectArrayEventType) first.getGoesToTypes()[0], methodResolutionService.getEngineImportService().getDefaultMathContext());
            }
            return new EnumEvalAverageBigDecimalEvents(first.getBodyEvaluator(), first.getStreamCountIncoming(), methodResolutionService.getEngineImportService().getDefaultMathContext());
        }
        super.setTypeInfo(ExpressionReturnType.singleValue(Double.class));
        if (inputEventType == null) {
            return new EnumEvalAverageScalarLambda(first.getBodyEvaluator(), first.getStreamCountIncoming(),
                    (ObjectArrayEventType) first.getGoesToTypes()[0]);
        }
        return new EnumEvalAverageEvents(first.getBodyEvaluator(), first.getStreamCountIncoming());
    }
View Full Code Here

        if (bodiesAndParameters.isEmpty()) {
            super.setTypeInfo(ExpressionReturnType.collectionOfSingleValue(collectionComponentType));
            return new EnumEvalDistinctScalar(numStreamsIncoming);
        }

        ExprDotEvalParamLambda first = (ExprDotEvalParamLambda) bodiesAndParameters.get(0);
        if (inputEventType == null) {
            super.setTypeInfo(ExpressionReturnType.collectionOfSingleValue(collectionComponentType));
            return new EnumEvalDistinctScalarLambda(first.getBodyEvaluator(), first.getStreamCountIncoming(),
                    (ObjectArrayEventType) first.getGoesToTypes()[0]);
        }
        super.setTypeInfo(ExpressionReturnType.collectionOfEvents(inputEventType));
        return new EnumEvalDistinctEvents(first.getBodyEvaluator(), first.getStreamCountIncoming());
    }
View Full Code Here

    public EventType[] getAddStreamTypes(String enumMethodUsedName, List<String> goesToNames, EventType inputEventType, Class collectionComponentType, List<ExprDotEvalParam> bodiesAndParameters) {
        return ExprDotNodeUtility.getSingleLambdaParamEventType(enumMethodUsedName, goesToNames, inputEventType, collectionComponentType);
    }

    public EnumEval getEnumEval(MethodResolutionService methodResolutionService, EventAdapterService eventAdapterService, StreamTypeService streamTypeService, String statementId, String enumMethodUsedName, List<ExprDotEvalParam> bodiesAndParameters, EventType inputEventType, Class collectionComponentType, int numStreamsIncoming, boolean disablePropertyExpressionEventCollCache) {
        ExprDotEvalParamLambda first = (ExprDotEvalParamLambda) bodiesAndParameters.get(0);
        Class returnType = first.getBodyEvaluator().getType();
        super.setTypeInfo(ExpressionReturnType.collectionOfSingleValue(returnType));
        if (inputEventType == null) {
            return new EnumEvalSelectFromScalarLambda(first.getBodyEvaluator(), first.getStreamCountIncoming(),
                    (ObjectArrayEventType) first.getGoesToTypes()[0]);
        }
        return new EnumEvalSelectFromEvents(first.getBodyEvaluator(), first.getStreamCountIncoming());
    }
View Full Code Here

        return ExprDotNodeUtility.getSingleLambdaParamEventType(enumMethodUsedName, goesToNames, inputEventType, collectionComponentType);
    }

    public EnumEval getEnumEval(MethodResolutionService methodResolutionService, EventAdapterService eventAdapterService, StreamTypeService streamTypeService, String statementId, String enumMethodUsedName, List<ExprDotEvalParam> bodiesAndParameters, EventType inputEventType, Class collectionComponentType, int numStreamsIncoming, boolean disablePropertyExpressionEventCollCache) {
        super.setTypeInfo(ExpressionReturnType.singleValue(Map.class));
        ExprDotEvalParamLambda first = (ExprDotEvalParamLambda) bodiesAndParameters.get(0);
        if (bodiesAndParameters.size() == 2) {
            ExprDotEvalParamLambda second = (ExprDotEvalParamLambda) bodiesAndParameters.get(1);
            if (inputEventType == null) {
                return new EnumEvalGroupByKeyValueSelectorScalarLambda(first.getBodyEvaluator(), first.getStreamCountIncoming(), second.getBodyEvaluator(),
                        (ObjectArrayEventType) first.getGoesToTypes()[0]);
            }
            return new EnumEvalGroupByKeyValueSelectorEvents(first.getBodyEvaluator(), first.getStreamCountIncoming(), second.getBodyEvaluator());
        }
        if (inputEventType == null) {
            return new EnumEvalGroupByKeySelectorScalarLambda(first.getBodyEvaluator(), first.getStreamCountIncoming(),
                    (ObjectArrayEventType) first.getGoesToTypes()[0]);
        }
View Full Code Here

        return new EventType[]{firstParamType, indexEventType};
    }

    public EnumEval getEnumEval(MethodResolutionService methodResolutionService, EventAdapterService eventAdapterService, StreamTypeService streamTypeService, String statementId, String enumMethodUsedName, List<ExprDotEvalParam> bodiesAndParameters, EventType inputEventType, Class collectionComponentType, int numStreamsIncoming, boolean disablePropertyExpressionEventCollCache) {

        ExprDotEvalParamLambda first = (ExprDotEvalParamLambda) bodiesAndParameters.get(0);

        if (inputEventType != null) {
            super.setTypeInfo(ExpressionReturnType.collectionOfEvents(inputEventType));
            if (first.getGoesToNames().size() == 1) {
                return new EnumEvalWhereEvents(first.getBodyEvaluator(), first.getStreamCountIncoming());
            }
            return new EnumEvalWhereIndexEvents(first.getBodyEvaluator(), first.getStreamCountIncoming(), (ObjectArrayEventType) first.getGoesToTypes()[1]);
        }

        super.setTypeInfo(ExpressionReturnType.collectionOfSingleValue(collectionComponentType));
        if (first.getGoesToNames().size() == 1) {
            return new EnumEvalWhereScalar(first.getBodyEvaluator(), first.getStreamCountIncoming(), (ObjectArrayEventType) first.getGoesToTypes()[0]);
        }
        return new EnumEvalWhereScalarIndex(first.getBodyEvaluator(), first.getStreamCountIncoming(), (ObjectArrayEventType) first.getGoesToTypes()[0], (ObjectArrayEventType) first.getGoesToTypes()[1]);
    }
View Full Code Here

        return ExprDotNodeUtility.getSingleLambdaParamEventType(enumMethodUsedName, goesToNames, inputEventType, collectionComponentType);
    }

    public EnumEval getEnumEval(MethodResolutionService methodResolutionService, EventAdapterService eventAdapterService, StreamTypeService streamTypeService, String statementId, String enumMethodUsedName, List<ExprDotEvalParam> bodiesAndParameters, EventType inputEventType, Class collectionComponentType, int numStreamsIncoming, boolean disablePropertyExpressionEventCollCache) {
        super.setTypeInfo(ExpressionReturnType.singleValue(Map.class));
        ExprDotEvalParamLambda first = (ExprDotEvalParamLambda) bodiesAndParameters.get(0);
        ExprDotEvalParamLambda second = (ExprDotEvalParamLambda) bodiesAndParameters.get(1);
        if (inputEventType == null) {
            return new EnumEvalToMapScalarLambda(first.getBodyEvaluator(), first.getStreamCountIncoming(), second.getBodyEvaluator(),
                    (ObjectArrayEventType) first.getGoesToTypes()[0]);
        }
        return new EnumEvalToMapEvents(first.getBodyEvaluator(), first.getStreamCountIncoming(), second.getBodyEvaluator());
    }
View Full Code Here

            ExprDotEvalSumMethodFactory aggMethodFactory = getAggregatorFactory(collectionComponentType);
            super.setTypeInfo(ExpressionReturnType.singleValue(JavaClassHelper.getBoxedType(aggMethodFactory.getValueType())));
            return new EnumEvalSumScalar(numStreamsIncoming, aggMethodFactory);
        }

        ExprDotEvalParamLambda first = (ExprDotEvalParamLambda) bodiesAndParameters.get(0);
        ExprDotEvalSumMethodFactory aggMethodFactory = getAggregatorFactory(first.getBodyEvaluator().getType());
        Class returnType = JavaClassHelper.getBoxedType(aggMethodFactory.getValueType());
        super.setTypeInfo(ExpressionReturnType.singleValue(returnType));
        if (inputEventType == null) {
            return new EnumEvalSumScalarLambda(first.getBodyEvaluator(), first.getStreamCountIncoming(), aggMethodFactory,
                    (ObjectArrayEventType) first.getGoesToTypes()[0]);
        }
        return new EnumEvalSumEvents(first.getBodyEvaluator(), first.getStreamCountIncoming(), aggMethodFactory);
    }
View Full Code Here

    public EventType[] getAddStreamTypes(String enumMethodUsedName, List<String> goesToNames, EventType inputEventType, Class collectionComponentType, List<ExprDotEvalParam> bodiesAndParameters) {
        return new EventType[] {inputEventType};
    }

    public EnumEval getEnumEval(StreamTypeService streamTypeService, String enumMethodUsedName, List<ExprDotEvalParam> bodiesAndParameters, EventType inputEventType, Class collectionComponentType, int numStreamsIncoming) {
        ExprDotEvalParamLambda first = (ExprDotEvalParamLambda) bodiesAndParameters.get(0);
        Class returnType = first.getBodyEvaluator().getType();
        super.setTypeInfo(ExprDotEvalTypeInfo.componentColl(returnType));
        return new EnumEvalSelectFrom(first.getBodyEvaluator(), first.getStreamCountIncoming());
    }
View Full Code Here

TOP

Related Classes of com.espertech.esper.epl.enummethod.dot.ExprDotEvalParamLambda

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.