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


Java CalendarOpUtil类代码示例

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


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

示例1: getForge

import com.espertech.esper.epl.datetime.calop.CalendarOpUtil; //导入依赖的package包/类
public ReformatForge getForge(EPType inputType, TimeZone timeZone, TimeAbacus timeAbacus, DatetimeMethodEnum method, String methodNameUsed, List<ExprNode> parameters, ExprEvaluatorContext exprEvaluatorContext) throws ExprValidationException {
    if (method == DatetimeMethodEnum.GET) {
        CalendarFieldEnum fieldNum = CalendarOpUtil.getEnum(methodNameUsed, parameters.get(0));
        return new ReformatGetFieldForge(fieldNum, timeZone, timeAbacus);
    }
    if (method == DatetimeMethodEnum.FORMAT) {
        if (parameters.isEmpty()) {
            return FORMAT_STRING;
        }
        Object formatter = CalendarOpUtil.getFormatter(inputType, methodNameUsed, parameters.get(0), exprEvaluatorContext);
        return new ReformatFormatForge(formatter, timeAbacus);
    }
    if (method == DatetimeMethodEnum.TOCALENDAR) {
        return new ReformatToCalendarForge(timeZone, timeAbacus);
    }
    if (method == DatetimeMethodEnum.TOMILLISEC) {
        return new ReformatToMillisecForge(timeZone);
    }
    if (method == DatetimeMethodEnum.TODATE) {
        return new ReformatFormatToDateForge(timeZone, timeAbacus);
    }
    if (method == DatetimeMethodEnum.GETDAYOFMONTH) {
        return new ReformatEvalForge(CalendarEvalStatics.DAY_OF_MONTH, LocalDateTimeEvalStatics.DAY_OF_MONTH, ZonedDateTimeEvalStatics.DAY_OF_MONTH, timeZone, timeAbacus);
    }
    if (method == DatetimeMethodEnum.GETMINUTEOFHOUR) {
        return new ReformatEvalForge(CalendarEvalStatics.MINUTE_OF_HOUR, LocalDateTimeEvalStatics.MINUTE_OF_HOUR, ZonedDateTimeEvalStatics.MINUTE_OF_HOUR, timeZone, timeAbacus);
    }
    if (method == DatetimeMethodEnum.GETMONTHOFYEAR) {
        return new ReformatEvalForge(CalendarEvalStatics.MONTH_OF_YEAR, LocalDateTimeEvalStatics.MONTH_OF_YEAR, ZonedDateTimeEvalStatics.MONTH_OF_YEAR, timeZone, timeAbacus);
    }
    if (method == DatetimeMethodEnum.GETDAYOFWEEK) {
        return new ReformatEvalForge(CalendarEvalStatics.DAY_OF_WEEK, LocalDateTimeEvalStatics.DAY_OF_WEEK, ZonedDateTimeEvalStatics.DAY_OF_WEEK, timeZone, timeAbacus);
    }
    if (method == DatetimeMethodEnum.GETDAYOFYEAR) {
        return new ReformatEvalForge(CalendarEvalStatics.DAY_OF_YEAR, LocalDateTimeEvalStatics.DAY_OF_YEAR, ZonedDateTimeEvalStatics.DAY_OF_YEAR, timeZone, timeAbacus);
    }
    if (method == DatetimeMethodEnum.GETERA) {
        return new ReformatEvalForge(CalendarEvalStatics.ERA, LocalDateTimeEvalStatics.ERA, ZonedDateTimeEvalStatics.ERA, timeZone, timeAbacus);
    }
    if (method == DatetimeMethodEnum.GETHOUROFDAY) {
        return new ReformatEvalForge(CalendarEvalStatics.HOUR_OF_DAY, LocalDateTimeEvalStatics.HOUR_OF_DAY, ZonedDateTimeEvalStatics.HOUR_OF_DAY, timeZone, timeAbacus);
    }
    if (method == DatetimeMethodEnum.GETMILLISOFSECOND) {
        return new ReformatEvalForge(CalendarEvalStatics.MILLIS_OF_SECOND, LocalDateTimeEvalStatics.MILLIS_OF_SECOND, ZonedDateTimeEvalStatics.MILLIS_OF_SECOND, timeZone, timeAbacus);
    }
    if (method == DatetimeMethodEnum.GETSECONDOFMINUTE) {
        return new ReformatEvalForge(CalendarEvalStatics.SECOND_OF_MINUTE, LocalDateTimeEvalStatics.SECOND_OF_MINUTE, ZonedDateTimeEvalStatics.SECOND_OF_MINUTE, timeZone, timeAbacus);
    }
    if (method == DatetimeMethodEnum.GETWEEKYEAR) {
        return new ReformatEvalForge(CalendarEvalStatics.WEEKYEAR, LocalDateTimeEvalStatics.WEEKYEAR, ZonedDateTimeEvalStatics.WEEKYEAR, timeZone, timeAbacus);
    }
    if (method == DatetimeMethodEnum.GETYEAR) {
        return new ReformatEvalForge(CalendarEvalStatics.YEAR, LocalDateTimeEvalStatics.YEAR, ZonedDateTimeEvalStatics.YEAR, timeZone, timeAbacus);
    }
    if (method == DatetimeMethodEnum.BETWEEN) {
        if (ExprNodeUtilityRich.isAllConstants(parameters)) {
            return new ReformatBetweenConstantParamsForge(parameters, timeZone);
        }
        return new ReformatBetweenNonConstantParamsForge(parameters, timeZone);
    }
    throw new IllegalStateException("Unrecognized date-time method code '" + method + "'");
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:63,代码来源:ReformatForgeFactory.java

示例2: getOp

import com.espertech.esper.epl.datetime.calop.CalendarOpUtil; //导入依赖的package包/类
public ReformatOp getOp(DatetimeMethodEnum method, String methodNameUsed, List<ExprNode> parameters) throws ExprValidationException {
    if (method == DatetimeMethodEnum.GET) {
        CalendarFieldEnum fieldNum = CalendarOpUtil.getEnum(methodNameUsed, parameters.get(0));
        return new ReformatOpGetField(fieldNum);
    }
    if (method == DatetimeMethodEnum.FORMAT) {
        return FormatString;
    }
    if (method == DatetimeMethodEnum.TOCALENDAR) {
        return ToCal;
    }
    if (method == DatetimeMethodEnum.TOMILLISEC) {
        return ToMsec;
    }
    if (method == DatetimeMethodEnum.TODATE) {
        return ToDate;
    }
    if (method == DatetimeMethodEnum.GETDAYOFMONTH) {
        return new ReformatOpCalendarEval(CalendarEvalStatics.DayOfMonth);
    }
    if (method == DatetimeMethodEnum.GETMINUTEOFHOUR) {
        return new ReformatOpCalendarEval(CalendarEvalStatics.MinuteOfHour);
    }
    if (method == DatetimeMethodEnum.GETMONTHOFYEAR) {
        return new ReformatOpCalendarEval(CalendarEvalStatics.MonthOfYear);
    }
    if (method == DatetimeMethodEnum.GETDAYOFWEEK) {
        return new ReformatOpCalendarEval(CalendarEvalStatics.DayOfWeek);
    }
    if (method == DatetimeMethodEnum.GETDAYOFYEAR) {
        return new ReformatOpCalendarEval(CalendarEvalStatics.DayOfYear);
    }
    if (method == DatetimeMethodEnum.GETERA) {
        return new ReformatOpCalendarEval(CalendarEvalStatics.Era);
    }
    if (method == DatetimeMethodEnum.GETHOUROFDAY) {
        return new ReformatOpCalendarEval(CalendarEvalStatics.HourOfDay);
    }
    if (method == DatetimeMethodEnum.GETMILLISOFSECOND) {
        return new ReformatOpCalendarEval(CalendarEvalStatics.MillisOfSecond);
    }
    if (method == DatetimeMethodEnum.GETSECONDOFMINUTE) {
        return new ReformatOpCalendarEval(CalendarEvalStatics.SecondOfMinute);
    }
    if (method == DatetimeMethodEnum.GETWEEKYEAR) {
        return new ReformatOpCalendarEval(CalendarEvalStatics.Weekyear);
    }
    if (method == DatetimeMethodEnum.GETYEAR) {
        return new ReformatOpCalendarEval(CalendarEvalStatics.Year);
    }
    if (method == DatetimeMethodEnum.BETWEEN) {
        if (ExprNodeUtility.isAllConstants(parameters)) {
            return new ReformatOpBetweenConstantParams(parameters);
        }
        return new ReformatOpBetweenNonConstantParams(parameters);
    }
    throw new IllegalStateException("Unrecognized date-time method code '" + method + "'");
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:59,代码来源:ReformatOpFactory.java


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