本文整理匯總了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();
}