Package com.espertech.esper.util

Examples of com.espertech.esper.util.SimpleNumberCoercer


        {
            if (!JavaClassHelper.isNumeric(coercionType))
            {
                throw new ExprValidationException("Cannot convert datatype '" + coercionType.getName() + "' to a numeric value");
            }
            SimpleNumberCoercer numberCoercerLHS = SimpleNumberCoercerFactory.getCoercer(typeOne, coercionType);
            SimpleNumberCoercer numberCoercerRHS = SimpleNumberCoercerFactory.getCoercer(typeTwo, coercionType);
            evaluator = new ExprEqualsEvaluatorCoercing(isIs, isNotEquals, evaluators[0], evaluators[1], numberCoercerLHS, numberCoercerRHS);
        }
    }
View Full Code Here


                    return null;
                }
                if ((returnType != null) && (returnType.getClass().isArray())) {
                    return null;
                }
                SimpleNumberCoercer coercer = getNumberCoercer(left.getExprEvaluator().getType(), contextPropertyNode.getType(), lookupable.getExpression());
                listofValues.add(new InSetOfValuesContextProp(contextPropertyNode.getPropertyName(), contextPropertyNode.getGetter(), coercer));
            }
            if (subNode instanceof ExprIdentNode)
            {
                ExprIdentNode identNodeInner = (ExprIdentNode) subNode;
View Full Code Here

        if ((left instanceof ExprFilterOptimizableNode) && (right instanceof ExprContextPropertyNode)) {
            ExprFilterOptimizableNode filterOptimizableNode = (ExprFilterOptimizableNode) left;
            ExprContextPropertyNode ctxNode = (ExprContextPropertyNode) right;
            FilterSpecLookupable lookupable = filterOptimizableNode.getFilterLookupable();
            if (filterOptimizableNode.getFilterLookupEligible()) {
                SimpleNumberCoercer numberCoercer = getNumberCoercer(lookupable.getReturnType(), ctxNode.getType(), lookupable.getExpression());
                return new FilterSpecParamContextProp(lookupable, op, ctxNode.getPropertyName(), ctxNode.getGetter(), numberCoercer);
            }
        }
        if ((left instanceof ExprContextPropertyNode) && (right instanceof ExprFilterOptimizableNode)) {
            ExprFilterOptimizableNode filterOptimizableNode = (ExprFilterOptimizableNode) right;
            ExprContextPropertyNode ctxNode = (ExprContextPropertyNode) left;
            FilterSpecLookupable lookupable = filterOptimizableNode.getFilterLookupable();
            if (filterOptimizableNode.getFilterLookupEligible()) {
                op = getReversedOperator(constituent, op); // reverse operators, as the expression is "stream1.prop xyz stream0.prop"
                SimpleNumberCoercer numberCoercer = getNumberCoercer(lookupable.getReturnType(), ctxNode.getType(), lookupable.getExpression());
                return new FilterSpecParamContextProp(lookupable, op, ctxNode.getPropertyName(), ctxNode.getGetter(), numberCoercer);
            }
        }
        return null;
    }
View Full Code Here

        String propertyName = identNodeLeft.getResolvedPropertyName();

        Class leftType = identNodeLeft.getExprEvaluator().getType();
        Class rightType = identNodeRight.getExprEvaluator().getType();

        SimpleNumberCoercer numberCoercer = getNumberCoercer(leftType, rightType, propertyName);
        boolean isMustCoerce = numberCoercer != null;
        Class numericCoercionType = JavaClassHelper.getBoxedType(leftType);

        String streamName = identNodeRight.getResolvedStreamName();
        if (arrayEventTypes != null && !arrayEventTypes.isEmpty() && arrayEventTypes.containsKey(streamName))
View Full Code Here

            throws ExprValidationException
    {
        String propertyName = identNodeLeft.getResolvedPropertyName();

        boolean isMustCoerce = false;
        SimpleNumberCoercer numberCoercer = null;
        Class numericCoercionType = JavaClassHelper.getBoxedType(identNodeLeft.getExprEvaluator().getType());
        if (identNodeRight.getExprEvaluator().getType() != identNodeLeft.getExprEvaluator().getType())
        {
            if (JavaClassHelper.isNumeric(identNodeRight.getExprEvaluator().getType()))
            {
View Full Code Here

        {
            if (!JavaClassHelper.isNumeric(coercionType))
            {
                throw new ExprValidationException("Cannot convert datatype '" + coercionType.getName() + "' to a numeric value");
            }
            SimpleNumberCoercer numberCoercerLHS = SimpleNumberCoercerFactory.getCoercer(typeOne, coercionType);
            SimpleNumberCoercer numberCoercerRHS = SimpleNumberCoercerFactory.getCoercer(typeTwo, coercionType);
            evaluator = new ExprEqualsEvaluatorCoercing(this, evaluators[0], evaluators[1], numberCoercerLHS, numberCoercerRHS);
        }
    }
View Full Code Here

                        return null;
                    }
                    if ((returnType != null) && (returnType.getClass().isArray())) {
                        return null;
                    }
                    SimpleNumberCoercer coercer = getNumberCoercer(left.getExprEvaluator().getType(), contextPropertyNode.getType(), propertyName);
                    listofValues.add(new InSetOfValuesContextProp(contextPropertyNode.getPropertyName(), contextPropertyNode.getGetter(), coercer));
                }
                if (subNode instanceof ExprIdentNode)
                {
                    ExprIdentNode identNodeInner = (ExprIdentNode) subNode;
View Full Code Here

        if ((left instanceof ExprIdentNode) && (right instanceof ExprContextPropertyNode)) {
            ExprIdentNode identNodeLeft = (ExprIdentNode) left;
            ExprContextPropertyNode ctxNode = (ExprContextPropertyNode) right;
            if (identNodeLeft.getStreamId() == 0) {
                SimpleNumberCoercer numberCoercer = getNumberCoercer(identNodeLeft.getExprEvaluator().getType(), ctxNode.getType(), identNodeLeft.getResolvedPropertyName());
                return new FilterSpecParamContextProp(identNodeLeft.getResolvedPropertyName(), op, ctxNode.getGetter(), numberCoercer);
            }
        }
        if ((left instanceof ExprContextPropertyNode) && (right instanceof ExprIdentNode)) {
            ExprIdentNode identNodeRight = (ExprIdentNode) right;
            ExprContextPropertyNode ctxNode = (ExprContextPropertyNode) left;
            if (identNodeRight.getStreamId() == 0) {
                op = getReversedOperator(constituent, op); // reverse operators, as the expression is "stream1.prop xyz stream0.prop"
                SimpleNumberCoercer numberCoercer = getNumberCoercer(identNodeRight.getExprEvaluator().getType(), ctxNode.getType(), identNodeRight.getResolvedPropertyName());
                return new FilterSpecParamContextProp(identNodeRight.getResolvedPropertyName(), op, ctxNode.getGetter(), numberCoercer);
            }
        }
        return null;
    }
View Full Code Here

        String propertyName = identNodeLeft.getResolvedPropertyName();

        Class leftType = identNodeLeft.getExprEvaluator().getType();
        Class rightType = identNodeRight.getExprEvaluator().getType();

        SimpleNumberCoercer numberCoercer = getNumberCoercer(leftType, rightType, propertyName);
        boolean isMustCoerce = numberCoercer != null;
        Class numericCoercionType = JavaClassHelper.getBoxedType(leftType);

        String streamName = identNodeRight.getResolvedStreamName();
        if (!arrayEventTypes.isEmpty() && arrayEventTypes.containsKey(streamName))
View Full Code Here

                    return null;
                }
                if ((returnType != null) && (returnType.getClass().isArray())) {
                    return null;
                }
                SimpleNumberCoercer coercer = getNumberCoercer(left.getExprEvaluator().getType(), contextPropertyNode.getType(), lookupable.getExpression());
                listofValues.add(new InSetOfValuesContextProp(contextPropertyNode.getPropertyName(), contextPropertyNode.getGetter(), coercer));
            }
            if (subNode instanceof ExprIdentNode)
            {
                ExprIdentNode identNodeInner = (ExprIdentNode) subNode;
View Full Code Here

TOP

Related Classes of com.espertech.esper.util.SimpleNumberCoercer

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.