Package com.espertech.esper.epl.datetime.interval

Source Code of com.espertech.esper.epl.datetime.interval.ExprOptionalConstant

/*
* *************************************************************************************
*  Copyright (C) 2008 EsperTech, Inc. All rights reserved.                            *
*  http://esper.codehaus.org                                                          *
*  http://www.espertech.com                                                           *
*  ---------------------------------------------------------------------------------- *
*  The software in this package is published under the terms of the GPL license       *
*  a copy of which has been included with this distribution in the license.txt file.  *
* *************************************************************************************
*/

package com.espertech.esper.epl.datetime.interval;

import com.espertech.esper.epl.expression.ExprConstantNode;
import com.espertech.esper.epl.expression.ExprConstantNodeImpl;
import com.espertech.esper.epl.expression.ExprEvaluator;

public class ExprOptionalConstant {
    private final ExprEvaluator evaluator;
    private final Long optionalConstant;

    public ExprOptionalConstant(ExprEvaluator evaluator, Long optionalConstant) {
        this.evaluator = evaluator;
        this.optionalConstant = optionalConstant;
    }

    public ExprOptionalConstant(ExprEvaluator evaluator) {
        this.evaluator = evaluator;
        this.optionalConstant = null;
    }

    public Long getOptionalConstant() {
        return optionalConstant;
    }

    public ExprEvaluator getEvaluator() {
        return evaluator;
    }

    public static ExprOptionalConstant make(long maxValue) {
        ExprConstantNode constantNode = new ExprConstantNodeImpl(maxValue);
        return new ExprOptionalConstant(constantNode.getExprEvaluator(), maxValue);
    }
}
TOP

Related Classes of com.espertech.esper.epl.datetime.interval.ExprOptionalConstant

TOP
Copyright © 2018 www.massapi.com. 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.