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

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

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

Time.before介绍

暂无

代码示例

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

/**
 * Determines if this <code>TimeFrame</code> contains a given point in time.
 * 
 * @param time
 *            the <code>Time</code> to check
 * @return <code>true</code> if this <code>TimeFrame</code> contains the given time
 */
public boolean contains(final Time time)
{
  return (start.equals(time) || start.before(time)) && end.after(time);
}

代码示例来源:origin: de.agilecoders.wicket/bootstrap

/**
 * updates the last modification time
 *
 * @param resource the recently added import
 */
private void updateLastModified(ILessResource resource) {
  if (lastModified.before(resource.getLastModificationTime())) {
    lastModified = resource.getLastModificationTime();
  }
}

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

/**
 * Determines if this <code>TimeFrame</code> contains a given point in time.
 * 
 * @param time
 *            the <code>Time</code> to check
 * @return <code>true</code> if this <code>TimeFrame</code> contains the given time
 */
public boolean contains(final Time time)
{
  return (start.equals(time) || start.before(time)) && end.after(time);
}

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

/**
 * Determines if this <code>TimeFrame</code> contains a given point in time.
 * 
 * @param time
 *            the <code>Time</code> to check
 * @return <code>true</code> if this <code>TimeFrame</code> contains the given time
 */
public boolean contains(final Time time)
{
  return (start.equals(time) || start.before(time)) && end.after(time);
}

代码示例来源: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: apache/wicket

/**
 * Check to determine if the resource data needs to be written. This method checks the
 * <code>If-Modified-Since</code> request header and compares it to lastModified property.
 * In order for this method to work {@link #setLastModified(Time)} has to be called first.
 * 
 * @param attributes
 *            request attributes
 * @return <code>true</code> if the resource data does need to be written,
 *         <code>false</code> otherwise.
 */
public boolean dataNeedsToBeWritten(Attributes attributes)
{
  WebRequest request = (WebRequest)attributes.getRequest();
  Time ifModifiedSince = request.getIfModifiedSinceHeader();
  if (cacheDuration != Duration.NONE && ifModifiedSince != null && lastModified != null)
  {
    // [Last-Modified] headers have a maximum precision of one second
    // so we have to truncate the milliseconds part for a proper compare.
    // that's stupid, since changes within one second will not be reliably
    // detected by the client ... any hint or clarification to improve this
    // situation will be appreciated...
    Time roundedLastModified = Time.millis(lastModified.getMilliseconds() / 1000 * 1000);
    return ifModifiedSince.before(roundedLastModified);
  }
  else
  {
    return true;
  }
}

代码示例来源: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: org.apache.wicket/wicket-core

/**
 * Check to determine if the resource data needs to be written. This method checks the
 * <code>If-Modified-Since</code> request header and compares it to lastModified property.
 * In order for this method to work {@link #setLastModified(Time)} has to be called first.
 * 
 * @param attributes
 *            request attributes
 * @return <code>true</code> if the resource data does need to be written,
 *         <code>false</code> otherwise.
 */
public boolean dataNeedsToBeWritten(Attributes attributes)
{
  WebRequest request = (WebRequest)attributes.getRequest();
  Time ifModifiedSince = request.getIfModifiedSinceHeader();
  if (cacheDuration != Duration.NONE && ifModifiedSince != null && lastModified != null)
  {
    // [Last-Modified] headers have a maximum precision of one second
    // so we have to truncate the milliseconds part for a proper compare.
    // that's stupid, since changes within one second will not be reliably
    // detected by the client ... any hint or clarification to improve this
    // situation will be appreciated...
    Time roundedLastModified = Time.millis(lastModified.getMilliseconds() / 1000 * 1000);
    return ifModifiedSince.before(roundedLastModified);
  }
  else
  {
    return true;
  }
}

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

ifModifiedSinceFromRequestTime.before(pageModificationTime))

代码示例来源:origin: org.apache.wicket.experimental.wicket8/wicket-http2-core

ifModifiedSinceFromRequestTime.before(pageModificationTime))

相关文章