本文整理汇总了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);
}
示例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");
}
}
}
示例3: ExprNumberSetCronParam
import com.espertech.esper.type.CronOperatorEnum; //导入依赖的package包/类
/**
* Ctor.
* @param cronOperator type of cron parameter
*/
public ExprNumberSetCronParam(CronOperatorEnum cronOperator)
{
this.cronOperator = cronOperator;
}
示例4: getCronOperator
import com.espertech.esper.type.CronOperatorEnum; //导入依赖的package包/类
/**
* Returns the cron parameter type.
* @return type of cron parameter
*/
public CronOperatorEnum getCronOperator()
{
return cronOperator;
}
示例5: ExprNumberSetCronParam
import com.espertech.esper.type.CronOperatorEnum; //导入依赖的package包/类
/**
* Ctor.
*
* @param cronOperator type of cron parameter
*/
public ExprNumberSetCronParam(CronOperatorEnum cronOperator) {
this.cronOperator = cronOperator;
}
示例6: getCronOperator
import com.espertech.esper.type.CronOperatorEnum; //导入依赖的package包/类
/**
* Returns the cron parameter type.
*
* @return type of cron parameter
*/
public CronOperatorEnum getCronOperator() {
return cronOperator;
}