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

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

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

WeekDay.getCalendarDay介绍

[英]Returns the corresponding java.util.Calendar.DAY_OF_WEEK constant for the specified WeekDay.
[中]返回指定WeekDay的相应java.util.Calendar.DAY_OF_WEEK常量。

代码示例

代码示例来源: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: 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: 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: org.bedework/bw-ical4j-cl

/**
 * @param weekStartDay The weekStartDay to set.
 */
public final void setWeekStartDay(final String weekStartDay) {
  this.weekStartDay = weekStartDay;
  if (weekStartDay != null) {
    calendarWeekStartDay = WeekDay.getCalendarDay(new WeekDay(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) {
    List<Date> retVal = new ArrayList<>();
    final Calendar cal = getCalendarInstance(date, true);
    final int year = cal.get(Calendar.YEAR);
    // construct a list of possible year days..
    cal.set(Calendar.DAY_OF_YEAR, 1);
    while (cal.get(Calendar.YEAR) == year) {
      if (!dayList.stream().map(weekDay -> WeekDay.getCalendarDay(weekDay))
          .filter(calDay -> cal.get(Calendar.DAY_OF_WEEK) == calDay)
          .collect(Collectors.toList()).isEmpty()) {
        retVal.add(Dates.getInstance(cal.getTime(), type));
      }
      cal.add(Calendar.DAY_OF_YEAR, 1);
    }
    return retVal;
  }
}

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

@Override
  public List<Date> apply(Date date) {
    List<Date> retVal = new ArrayList<>();
    final Calendar cal = getCalendarInstance(date, true);
    final int year = cal.get(Calendar.YEAR);
    // construct a list of possible year days..
    cal.set(Calendar.DAY_OF_YEAR, 1);
    while (cal.get(Calendar.YEAR) == year) {
      if (!dayList.stream().map(weekDay -> WeekDay.getCalendarDay(weekDay))
          .filter(calDay -> cal.get(Calendar.DAY_OF_WEEK) == calDay)
          .collect(Collectors.toList()).isEmpty()) {
        retVal.add(Dates.getInstance(cal.getTime(), type));
      }
      cal.add(Calendar.DAY_OF_YEAR, 1);
    }
    return retVal;
  }
}

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

@Override
  public List<Date> apply(Date date) {
    List<Date> retVal = new ArrayList<>();
    final Calendar cal = getCalendarInstance(date, true);
    final int weekNo = cal.get(Calendar.WEEK_OF_YEAR);
    // construct a list of possible week days..
    cal.set(Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek());
    while (cal.get(Calendar.WEEK_OF_YEAR) == weekNo) {
      if (!dayList.stream().map(weekDay -> WeekDay.getCalendarDay(weekDay))
          .filter(calDay -> cal.get(Calendar.DAY_OF_WEEK) == calDay)
          .collect(Collectors.toList()).isEmpty()) {
        retVal.add(Dates.getInstance(cal.getTime(), type));
      }
      cal.add(Calendar.DAY_OF_WEEK, 1);
    }
    return retVal;
  }
}

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

@Override
  public List<Date> apply(Date date) {
    List<Date> retVal = new ArrayList<>();
    final Calendar cal = getCalendarInstance(date, true);
    final int month = cal.get(Calendar.MONTH);
    // construct a list of possible month days..
    cal.set(Calendar.DAY_OF_MONTH, 1);
    while (cal.get(Calendar.MONTH) == month) {
      if (!dayList.stream().map(weekDay -> WeekDay.getCalendarDay(weekDay))
          .filter(calDay -> cal.get(Calendar.DAY_OF_WEEK) == calDay)
          .collect(Collectors.toList()).isEmpty()) {
        retVal.add(Dates.getInstance(cal.getTime(), type));
      }
      cal.add(Calendar.DAY_OF_MONTH, 1);
    }
    return retVal;
  }
}

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

@Override
  public List<Date> apply(Date date) {
    List<Date> retVal = new ArrayList<>();
    final Calendar cal = getCalendarInstance(date, true);
    final int month = cal.get(Calendar.MONTH);
    // construct a list of possible month days..
    cal.set(Calendar.DAY_OF_MONTH, 1);
    while (cal.get(Calendar.MONTH) == month) {
      if (!dayList.stream().map(weekDay -> WeekDay.getCalendarDay(weekDay))
          .filter(calDay -> cal.get(Calendar.DAY_OF_WEEK) == calDay)
          .collect(Collectors.toList()).isEmpty()) {
        retVal.add(Dates.getInstance(cal.getTime(), type));
      }
      cal.add(Calendar.DAY_OF_MONTH, 1);
    }
    return retVal;
  }
}

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

@Override
  public List<Date> apply(Date date) {
    List<Date> retVal = new ArrayList<>();
    final Calendar cal = getCalendarInstance(date, true);
    final int weekNo = cal.get(Calendar.WEEK_OF_YEAR);
    // construct a list of possible week days..
    cal.set(Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek());
    while (cal.get(Calendar.WEEK_OF_YEAR) == weekNo) {
      if (!dayList.stream().map(weekDay -> WeekDay.getCalendarDay(weekDay))
          .filter(calDay -> cal.get(Calendar.DAY_OF_WEEK) == calDay)
          .collect(Collectors.toList()).isEmpty()) {
        retVal.add(Dates.getInstance(cal.getTime(), type));
      }
      cal.add(Calendar.DAY_OF_WEEK, 1);
    }
    return retVal;
  }
}

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

final int calDay = WeekDay.getCalendarDay(weekDay);
if (calDay == -1) {

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

final int calDay = WeekDay.getCalendarDay(weekDay);
if (calDay == -1) {

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

@Override
public DateList transform(DateList dates) {
  if (dayList.isEmpty()) {
    return dates;
  }
  final DateList weekDayDates = Dates.getDateListInstance(dates);
  Function<Date, List<Date>> transformer = null;
  switch (getFrequency()) {
    case WEEKLY: transformer = new WeeklyExpansionFilter(dates.getType()); break;
    case MONTHLY: transformer = new MonthlyExpansionFilter(dates.getType()); break;
    case YEARLY: transformer = new YearlyExpansionFilter(dates.getType()); break;
    case DAILY:
    default: transformer = new LimitFilter();
  }
  for (final Date date : dates) {
    List<Date> transformed = transformer.apply(date);
    // filter by offset
    List<Date> filtered = new ArrayList<>();
    dayList.forEach(day -> filtered.addAll(getOffsetDates(transformed.stream().filter(d ->
      getCalendarInstance(d, true).get(Calendar.DAY_OF_WEEK) == WeekDay.getCalendarDay(day))
      .collect(Collectors.toCollection(() -> Dates.getDateListInstance(weekDayDates))), day.getOffset())));
    weekDayDates.addAll(filtered);
  }
  return weekDayDates;
}

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

@Override
public DateList transform(DateList dates) {
  if (dayList.isEmpty()) {
    return dates;
  }
  final DateList weekDayDates = Dates.getDateListInstance(dates);
  Function<Date, List<Date>> transformer = null;
  switch (getFrequency()) {
    case WEEKLY: transformer = new WeeklyExpansionFilter(dates.getType()); break;
    case MONTHLY: transformer = new MonthlyExpansionFilter(dates.getType()); break;
    case YEARLY: transformer = new YearlyExpansionFilter(dates.getType()); break;
    case DAILY:
    default: transformer = new LimitFilter();
  }
  for (final Date date : dates) {
    List<Date> transformed = transformer.apply(date);
    // filter by offset
    List<Date> filtered = new ArrayList<>();
    dayList.forEach(day -> filtered.addAll(getOffsetDates(transformed.stream().filter(d ->
      getCalendarInstance(d, true).get(Calendar.DAY_OF_WEEK) == WeekDay.getCalendarDay(day))
      .collect(Collectors.toCollection(() -> Dates.getDateListInstance(weekDayDates))), day.getOffset())));
    weekDayDates.addAll(filtered);
  }
  return weekDayDates;
}

代码示例来源: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: 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.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)) {

相关文章