org.apache.wicket.util.time.Time.add()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(120)

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

Time.add介绍

[英]Adds the given Duration to this Time object, moving the time into the future.
[中]将给定的Duration添加到此Time对象,将时间移到未来。

代码示例

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Creates a <code>TimeFrame</code> for a start <code>Time</code> and <code>Duration</code>.
 * 
 * @param start
 *            the start <code>Time</code>
 * @param duration
 *            the <code>Duration</code>
 * @return the <code>TimeFrame</code>
 * @throws IllegalArgumentException
 *             thrown if start <code>Time</code> value is before end <code>Time</code> value
 */
public static TimeFrame valueOf(final Time start, final Duration duration)
{
  return new TimeFrame(start, start.add(duration));
}

代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Creates a <code>TimeFrame</code> for a start <code>Time</code> and <code>Duration</code>.
 * 
 * @param start
 *            the start <code>Time</code>
 * @param duration
 *            the <code>Duration</code>
 * @return the <code>TimeFrame</code>
 * @throws IllegalArgumentException
 *             thrown if start <code>Time</code> value is before end <code>Time</code> value
 */
public static TimeFrame valueOf(final Time start, final Duration duration)
{
  return new TimeFrame(start, start.add(duration));
}

代码示例来源:origin: org.apache.wicket/wicket-util

/**
 * Creates a <code>TimeFrame</code> for a start <code>Time</code> and <code>Duration</code>.
 * 
 * @param start
 *            the start <code>Time</code>
 * @param duration
 *            the <code>Duration</code>
 * @return the <code>TimeFrame</code>
 * @throws IllegalArgumentException
 *             thrown if start <code>Time</code> value is before end <code>Time</code> value
 */
public static TimeFrame valueOf(final Time start, final Duration duration)
{
  return new TimeFrame(start, start.add(duration));
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

startOfPeriod.add(frequency).fromNow().sleep();

代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket

startOfPeriod.add(frequency).fromNow().sleep();

代码示例来源:origin: org.apache.wicket/wicket-util

startOfPeriod.add(frequency).fromNow().sleep();

代码示例来源:origin: org.apache.wicket/wicket-util

/**
 * Retrieves the next occurrence of this <code>TimeOfDay</code> on the given
 * <code>Calendar</code>.
 * 
 * @param calendar
 *            the <code>Calendar</code> to use
 * @return the next occurrence of this <code>TimeOfDay</code> on the given <code>Calendar</code>
 */
public Time next(final Calendar calendar)
{
  // Get this time of day today
  final Time timeToday = Time.valueOf(calendar, this);
  // If it has already passed
  if (timeToday.before(Time.now()))
  {
    // Return the time tomorrow
    return Time.valueOf(calendar, this).add(Duration.ONE_DAY);
  }
  else
  {
    // Time hasn't happened yet today
    return timeToday;
  }
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Retrieves the next occurrence of this <code>TimeOfDay</code> on the given
 * <code>Calendar</code>.
 * 
 * @param calendar
 *            the <code>Calendar</code> to use
 * @return the next occurrence of this <code>TimeOfDay</code> on the given <code>Calendar</code>
 */
public Time next(final Calendar calendar)
{
  // Get this time of day today
  final Time timeToday = Time.valueOf(calendar, this);
  // If it has already passed
  if (timeToday.before(Time.now()))
  {
    // Return the time tomorrow
    return Time.valueOf(calendar, this).add(Duration.ONE_DAY);
  }
  else
  {
    // Time hasn't happened yet today
    return timeToday;
  }
}

代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Retrieves the next occurrence of this <code>TimeOfDay</code> on the given
 * <code>Calendar</code>.
 * 
 * @param calendar
 *            the <code>Calendar</code> to use
 * @return the next occurrence of this <code>TimeOfDay</code> on the given
 *         <code>Calendar</code>
 */
public Time next(final Calendar calendar)
{
  // Get this time of day today
  final Time timeToday = Time.valueOf(calendar, this);
  // If it has already passed
  if (timeToday.before(Time.now()))
  {
    // Return the time tomorrow
    return Time.valueOf(calendar, this).add(Duration.ONE_DAY);
  }
  else
  {
    // Time hasn't happened yet today
    return timeToday;
  }
}

代码示例来源:origin: apache/wicket

setDateHeader("Expires", now.add(duration));

代码示例来源:origin: org.apache.wicket/wicket-request

setDateHeader("Expires", now.add(duration));

相关文章