net.fortuna.ical4j.model.WeekDay.getWeekDay()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中net.fortuna.ical4j.model.WeekDay.getWeekDay()方法的一些代码示例,展示了WeekDay.getWeekDay()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WeekDay.getWeekDay()方法的具体详情如下:
包路径:net.fortuna.ical4j.model.WeekDay
类名称:WeekDay
方法名:getWeekDay

WeekDay.getWeekDay介绍

[英]Returns a weekday representation of the specified calendar.
[中]返回指定日历的工作日表示形式。

代码示例

代码示例来源:origin: org.bedework.ical4j/ical4j

/**
 * @param weekStartDay The weekStartDay to set.
 */
public final void setWeekStartDay(final WeekDay.Day weekStartDay) {
  this.weekStartDay = weekStartDay;
  if (weekStartDay != null) {
    calendarWeekStartDay = WeekDay.getCalendarDay(WeekDay.getWeekDay(weekStartDay));
  }
}

代码示例来源:origin: org.mnode.ical4j/ical4j

/**
 * @param weekStartDay The weekStartDay to set.
 * @deprecated will be removed in a future version to support immutable pattern.
 */
@Deprecated
public final void setWeekStartDay(final WeekDay.Day weekStartDay) {
  this.weekStartDay = weekStartDay;
  if (weekStartDay != null) {
    calendarWeekStartDay = WeekDay.getCalendarDay(WeekDay.getWeekDay(weekStartDay));
  }
}

代码示例来源:origin: ical4j/ical4j

/**
 * @param weekStartDay The weekStartDay to set.
 * @deprecated will be removed in a future version to support immutable pattern.
 */
@Deprecated
public final void setWeekStartDay(final WeekDay.Day weekStartDay) {
  this.weekStartDay = weekStartDay;
  if (weekStartDay != null) {
    calendarWeekStartDay = WeekDay.getCalendarDay(WeekDay.getWeekDay(weekStartDay));
  }
}

代码示例来源:origin: net.oneandone.ical4j/ical4j

/**
 * @param weekStartDay The weekStartDay to set.
 */
public final void setWeekStartDay(final WeekDay.Day weekStartDay) {
  this.weekStartDay = weekStartDay;
  if (weekStartDay != null) {
    calendarWeekStartDay = WeekDay.getCalendarDay(WeekDay.getWeekDay(weekStartDay));
  }
}

代码示例来源:origin: ical4j/ical4j

public AbstractDateExpansionRule(Frequency frequency, Optional<WeekDay.Day> weekStartDay) {
  this.frequency = frequency;
  this.calendarWeekStartDay = WeekDay.getCalendarDay(WeekDay.getWeekDay(weekStartDay.orElse(WeekDay.Day.MO)));
}

代码示例来源:origin: org.mnode.ical4j/ical4j

public AbstractDateExpansionRule(Frequency frequency, Optional<WeekDay.Day> weekStartDay) {
  this.frequency = frequency;
  this.calendarWeekStartDay = WeekDay.getCalendarDay(WeekDay.getWeekDay(weekStartDay.orElse(WeekDay.Day.MO)));
}

代码示例来源:origin: ical4j/ical4j

@Override
  public List<Date> apply(Date date) {
    final Calendar cal = getCalendarInstance(date, true);
    if (dayList.contains(WeekDay.getWeekDay(cal))) {
      return Arrays.asList(date);
    }
    return Collections.emptyList();
  }
}

代码示例来源:origin: org.mnode.ical4j/ical4j

@Override
  public List<Date> apply(Date date) {
    final Calendar cal = getCalendarInstance(date, true);
    if (dayList.contains(WeekDay.getWeekDay(cal))) {
      return Arrays.asList(date);
    }
    return Collections.emptyList();
  }
}

代码示例来源:origin: ical4j/ical4j

public void testGetWeekDay() {
  Calendar cal = Calendar.getInstance();
  cal.setLenient(false);
  cal.set(2010, 4, 26, 12, 0);
  assertEquals(WeekDay.WE, WeekDay.getWeekDay(cal));
}

代码示例来源:origin: ical4j/ical4j

&& !weekNoList.isEmpty() && monthDayList.isEmpty())) {
ByDayRule implicitRule = new ByDayRule(new WeekDayList(WeekDay.getWeekDay(rootSeed)),
    deriveFilterType(),  Optional.ofNullable(weekStartDay));
dates = implicitRule.transform(dates);

代码示例来源:origin: net.oneandone.ical4j/ical4j

} else if (WKST.equals(token)) {
  weekStartDay = WeekDay.Day.valueOf(nextToken(tokens, token));
  calendarWeekStartDay = WeekDay.getCalendarDay(WeekDay.getWeekDay(weekStartDay));
} else {
  if (CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING)) {

代码示例来源:origin: org.mnode.ical4j/ical4j

&& !weekNoList.isEmpty() && monthDayList.isEmpty())) {
ByDayRule implicitRule = new ByDayRule(new WeekDayList(WeekDay.getWeekDay(rootSeed)),
    deriveFilterType(),  Optional.ofNullable(weekStartDay));
dates = implicitRule.transform(dates);

代码示例来源:origin: ical4j/ical4j

} else if (WKST.equals(token)) {
  weekStartDay = WeekDay.Day.valueOf(nextToken(tokens, token));
  calendarWeekStartDay = WeekDay.getCalendarDay(WeekDay.getWeekDay(weekStartDay));
} else {
  if (CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING)) {

代码示例来源:origin: org.bedework.ical4j/ical4j

} else if (WKST.equals(token)) {
  weekStartDay = WeekDay.Day.valueOf(nextToken(tokens, token));
  calendarWeekStartDay = WeekDay.getCalendarDay(WeekDay.getWeekDay(weekStartDay));
} else {
  if (CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING)) {

代码示例来源:origin: org.mnode.ical4j/ical4j

} else if (WKST.equals(token)) {
  weekStartDay = WeekDay.Day.valueOf(nextToken(tokens, token));
  calendarWeekStartDay = WeekDay.getCalendarDay(WeekDay.getWeekDay(weekStartDay));
} else {
  if (CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING)) {

代码示例来源:origin: org.bedework/bw-ical4j-cl

/**
 * Applies BYDAY rules specified in this Recur instance to the specified date list. If no BYDAY rules are specified
 * the date list is returned unmodified.
 * @param dates
 * @return
 */
private DateList getDayVariants(final DateList dates) {
  if (getDayList().isEmpty()) {
    return dates;
  }
  final DateList weekDayDates = getDateListInstance(dates);
  for (final Iterator i = dates.iterator(); i.hasNext();) {
    final Date date = (Date) i.next();
    for (final Iterator j = getDayList().iterator(); j.hasNext();) {
      final WeekDay weekDay = (WeekDay) j.next();
      // if BYYEARDAY or BYMONTHDAY is specified filter existing
      // list..
      if (!getYearDayList().isEmpty() || !getMonthDayList().isEmpty()) {
        final Calendar cal = getCalendarInstance(date, true);
        if (weekDay.equals(WeekDay.getWeekDay(cal))) {
          weekDayDates.add(date);
        }
      }
      else {
        weekDayDates.addAll(getAbsWeekDays(date, dates.getType(), weekDay));
      }
    }
  }
  return weekDayDates;
}

代码示例来源:origin: org.bedework.ical4j/ical4j

/**
 * Applies BYDAY rules specified in this Recur instance to the specified date list. If no BYDAY rules are specified
 * the date list is returned unmodified.
 *
 * @param dates
 * @return
 */
private DateList getDayVariants(final DateList dates) {
  if (getDayList().isEmpty()) {
    return dates;
  }
  final DateList weekDayDates = getDateListInstance(dates);
  for (final Date date : dates) {
    for (final WeekDay weekDay : getDayList()) {
      // if BYYEARDAY or BYMONTHDAY is specified filter existing
      // list..
      if (!getYearDayList().isEmpty() || !getMonthDayList().isEmpty()) {
        final Calendar cal = getCalendarInstance(date, true);
        if (weekDay.equals(WeekDay.getWeekDay(cal))) {
          weekDayDates.add(date);
        }
      } else {
        weekDayDates.addAll(getAbsWeekDays(date, dates.getType(), weekDay));
      }
    }
  }
  return weekDayDates;
}

代码示例来源:origin: net.oneandone.ical4j/ical4j

/**
 * Applies BYDAY rules specified in this Recur instance to the specified date list. If no BYDAY rules are specified
 * the date list is returned unmodified.
 *
 * @param dates
 * @return
 */
private DateList getDayVariants(final DateList dates) {
  if (getDayList().isEmpty()) {
    return dates;
  }
  final DateList weekDayDates = getDateListInstance(dates);
  for (final Date date : dates) {
    for (final WeekDay weekDay : getDayList()) {
      // if BYYEARDAY or BYMONTHDAY is specified filter existing
      // list..
      if (!getYearDayList().isEmpty() || !getMonthDayList().isEmpty()) {
        final Calendar cal = getCalendarInstance(date, true);
        if (weekDay.equals(WeekDay.getWeekDay(cal))) {
          weekDayDates.add(date);
        }
      } else {
        weekDayDates.addAll(getAbsWeekDays(date, dates.getType(), weekDay));
      }
    }
  }
  return weekDayDates;
}

相关文章