当前位置: 首页>>代码示例>>Java>>正文


Java CronOperatorEnum类代码示例

本文整理汇总了Java中com.espertech.esper.type.CronOperatorEnum的典型用法代码示例。如果您正苦于以下问题:Java CronOperatorEnum类的具体用法?Java CronOperatorEnum怎么用?Java CronOperatorEnum使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CronOperatorEnum类属于com.espertech.esper.type包,在下文中一共展示了CronOperatorEnum类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: evaluateCodegen

import com.espertech.esper.type.CronOperatorEnum; //导入依赖的package包/类
public CodegenExpression evaluateCodegen(Class requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) {
    CodegenExpression enumValue = enumValue(CronOperatorEnum.class, cronOperator.name());
    CodegenExpression defaultValue = newInstance(CronParameter.class, enumValue, constantNull());
    if (this.getChildNodes().length == 0) {
        return defaultValue;
    }
    ExprForge forge = this.getChildNodes()[0].getForge();
    Class evaluationType = forge.getEvaluationType();
    CodegenMethodNode methodNode = codegenMethodScope.makeChild(CronParameter.class, ExprNumberSetCronParam.class, codegenClassScope);

    CodegenBlock block = methodNode.getBlock()
            .declareVar(evaluationType, "value", forge.evaluateCodegen(requiredType, methodNode, exprSymbol, codegenClassScope));
    if (!evaluationType.isPrimitive()) {
        block.ifRefNull("value")
                .staticMethod(ExprNumberSetCronParam.class, METHOD_HANDLENUMBERSETCRONPARAMNULLVALUE)
                .blockReturn(defaultValue);
    }
    block.methodReturn(newInstance(CronParameter.class, enumValue, SimpleNumberCoercerFactory.SimpleNumberCoercerInt.codegenInt(ref("value"), evaluationType)));
    return localMethod(methodNode);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:21,代码来源:ExprNumberSetCronParam.java

示例2: increaseAfterDayOfMonthSpecialOp

import com.espertech.esper.type.CronOperatorEnum; //导入依赖的package包/类
private static void increaseAfterDayOfMonthSpecialOp(CronOperatorEnum operator, Integer day, Integer month, boolean week, Calendar after) {
    DateChecker checker;
    if (operator == CronOperatorEnum.LASTDAY) {
        if (!week) {
            checker = new DateCheckerLastDayOfMonth(day, month);
        } else {
            if (day == null) {
                checker = new DateCheckerLastDayOfWeek(month);
            } else {
                checker = new DateCheckerLastSpecificDayWeek(day, month);
            }
        }
    } else if (operator == CronOperatorEnum.LASTWEEKDAY) {
        checker = new DateCheckerLastWeekday(day, month);
    } else {
        checker = new DateCheckerMonthWeekday(day, month);
    }

    int dayCount = 0;
    while (!checker.fits(after)) {
        after.add(Calendar.DAY_OF_MONTH, 1);
        dayCount++;
        if (dayCount > 10000) {
            throw new IllegalArgumentException("Invalid crontab expression: failed to find match day");
        }
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:28,代码来源:ScheduleComputeHelper.java

示例3: ExprNumberSetCronParam

import com.espertech.esper.type.CronOperatorEnum; //导入依赖的package包/类
/**
 * Ctor.
 * @param cronOperator type of cron parameter
 */
public ExprNumberSetCronParam(CronOperatorEnum cronOperator)
{
    this.cronOperator = cronOperator;
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:9,代码来源:ExprNumberSetCronParam.java

示例4: getCronOperator

import com.espertech.esper.type.CronOperatorEnum; //导入依赖的package包/类
/**
 * Returns the cron parameter type.
 * @return type of cron parameter
 */
public CronOperatorEnum getCronOperator()
{
    return cronOperator;
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:9,代码来源:ExprNumberSetCronParam.java

示例5: ExprNumberSetCronParam

import com.espertech.esper.type.CronOperatorEnum; //导入依赖的package包/类
/**
 * Ctor.
 *
 * @param cronOperator type of cron parameter
 */
public ExprNumberSetCronParam(CronOperatorEnum cronOperator) {
    this.cronOperator = cronOperator;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:ExprNumberSetCronParam.java

示例6: getCronOperator

import com.espertech.esper.type.CronOperatorEnum; //导入依赖的package包/类
/**
 * Returns the cron parameter type.
 *
 * @return type of cron parameter
 */
public CronOperatorEnum getCronOperator() {
    return cronOperator;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:ExprNumberSetCronParam.java


注:本文中的com.espertech.esper.type.CronOperatorEnum类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。