org.jboss.as.ejb3.timerservice.schedule.attribute.Year.getNextMatch()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(104)

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

Year.getNextMatch介绍

暂无

代码示例

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

private Calendar computeNextYear(Calendar nextCal) {
  Integer nextYear = this.year.getNextMatch(nextCal);
  if (nextYear == null || nextYear > Year.MAX_YEAR) {
    return null;
  }
  int currentYear = nextCal.get(Calendar.YEAR);
  // if the current year is a match, then nothing else to
  // do. Just return back the calendar
  if (currentYear == nextYear) {
    return nextCal;
  }
  // If the next year is lesser than the current year, then
  // we have no more timeouts for the calendar expression
  if (nextYear < currentYear) {
    return null;
  }
  // at this point we have chosen a year which is greater than the current
  // year.
  // set the chosen year
  nextCal.set(Calendar.YEAR, nextYear);
  // since we are moving to a different year (as compared to the current year),
  // we should reset all other calendar attribute expressions appropriately, to their first possible
  // values
  nextCal.set(Calendar.MONTH, this.month.getFirstMatch());
  nextCal.set(Calendar.DAY_OF_MONTH, 1);
  resetTimeToFirstValues(nextCal);
  // recompute date
  nextCal = this.computeNextDate(nextCal);
  return nextCal;
}

代码示例来源:origin: org.jboss.as/jboss-as-ejb3

Integer nextYear = this.year.getNextMatch(currentCal);

相关文章

微信公众号

最新文章

更多