本文整理汇总了Java中org.apache.wicket.util.time.Duration.getMilliseconds方法的典型用法代码示例。如果您正苦于以下问题:Java Duration.getMilliseconds方法的具体用法?Java Duration.getMilliseconds怎么用?Java Duration.getMilliseconds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.util.time.Duration
的用法示例。
在下文中一共展示了Duration.getMilliseconds方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AbstractAjaxRestartableTimerBehavior
import org.apache.wicket.util.time.Duration; //导入方法依赖的package包/类
public AbstractAjaxRestartableTimerBehavior(final Duration updateInterval, String id) {
if (updateInterval == null || updateInterval.getMilliseconds() <= 0) {
throw new IllegalArgumentException("Invalid update interval");
}
this.updateInterval = updateInterval;
this.id = id;
}
示例2: setUpdateInterval
import org.apache.wicket.util.time.Duration; //导入方法依赖的package包/类
/**
* Sets the update interval duration. This method should only be called within the
* {@link #onTimer(AjaxRequestTarget)} method.
*
* @param updateInterval
*/
public final void setUpdateInterval(Duration updateInterval) {
if (updateInterval == null || updateInterval.getMilliseconds() <= 0) {
throw new IllegalArgumentException("Invalid update interval");
}
this.updateInterval = updateInterval;
}
示例3: getJsTimeoutCall
import org.apache.wicket.util.time.Duration; //导入方法依赖的package包/类
/**
* @param updateInterval Duration between AJAX callbacks
* @return JS script
*/
protected final String getJsTimeoutCall(final Duration updateInterval) {
// this might look strange, but it is necessary for IE not to leak :(
if (!stopped) {
return id + "=setTimeout(\"" + getCallbackScript() + "\", " + updateInterval.getMilliseconds() +
");";
}
return "setTimeout(\"" + getCallbackScript() + "\", " + updateInterval.getMilliseconds() +
");";
}
示例4: collectionTimer
import org.apache.wicket.util.time.Duration; //导入方法依赖的package包/类
public Builder collectionTimer(final Duration value) {
data.put("collectionTimer", value.getMilliseconds());
if (DefaultValues.collectionTimer == value.getMilliseconds()) {
data.remove("collectionTimer");
}
return this;
}
示例5: parse
import org.apache.wicket.util.time.Duration; //导入方法依赖的package包/类
@Override
public Long parse(String value) {
Duration d = Duration.valueOf(value);
return d == null || defaultValue.equals(d) ? null : d.getMilliseconds();
}