本文整理汇总了Java中net.fortuna.ical4j.model.WeekDayList类的典型用法代码示例。如果您正苦于以下问题:Java WeekDayList类的具体用法?Java WeekDayList怎么用?Java WeekDayList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WeekDayList类属于net.fortuna.ical4j.model包,在下文中一共展示了WeekDayList类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFrequency
import net.fortuna.ical4j.model.WeekDayList; //导入依赖的package包/类
public String getFrequency() {
if (recur == null) {
return null;
}
String extendedFrequency = recur.getFrequency();
WeekDayList dayList = recur.getDayList();
String dayListAsString = dayList.toString();
if (! dayList.isEmpty()) {
if ("MO,WE,FR".equals(dayListAsString)) {
extendedFrequency = new MWFRecurrenceRule().getFrequency();
}
if ("TU,TH".equals(dayListAsString)) {
extendedFrequency = new TThRecurrenceRule().getFrequency();
}
// if ("MO,TU,WE,TH,FR".equals(dayListAsString)) {
// extendedFrequency = new TThRecurrenceRule().getFrequency();
// }
}
String sakaiFrequency = frequencyLookup.get(extendedFrequency);
return sakaiFrequency;
}
示例2: getRecurrence
import net.fortuna.ical4j.model.WeekDayList; //导入依赖的package包/类
public static String getRecurrence(final String rule) {
if (rule != null) {
try {
final Recur recur = new Recur(rule);
final String frequency = recur.getFrequency();
final WeekDayList wdl = recur.getDayList();
final Integer interval = recur.getInterval();
if ((wdl != null && wdl.size() > 0)) {
// we only support one rule with daylist
return CalendarEntry.WORKDAILY;
} else if (interval != null && interval == 2) {
// we only support one rule with interval
return CalendarEntry.BIWEEKLY;
} else {
// native supportet rule
return frequency;
}
} catch (final ParseException e) {
log.error("cannot restore recurrence rule", e);
}
}
return null;
}