public class DeferredUpdater extends Object implements TimerListener
Updatable object and ensures that only the most recent update is actually executed.| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_DELAY
The default number of milliseconds to wait before executing an update.
|
| Constructor and Description |
|---|
DeferredUpdater(Updatable updatable)
Creates a new deferred updater for the specified
Updatable object. |
DeferredUpdater(Updatable updatable,
int delay)
Creates a new deferred updater for the specified
Updatable object. |
| Modifier and Type | Method and Description |
|---|---|
void |
deferUpdate()
Cancels any pending updates and schedule a new update for the underlying object.
|
void |
onElapsed(Timer sender)
Called whenever the delay period of the timer elapses.
|
public static final int DEFAULT_DELAY
public DeferredUpdater(Updatable updatable)
Updatable object. The updates are delayed with the
default number of milliseconds, 500. Only the most recent update is executed.updatable - the object whose updates are going to be deferredpublic DeferredUpdater(Updatable updatable, int delay)
Updatable object. The updates are delayed with the
specified number of milliseconds. Only the most recent update is executed.updatable - the object whose updates are going to be deferreddelay - the number of milliseconds to wait before executing an updatepublic void deferUpdate()
public void onElapsed(Timer sender)
TimerListeneronElapsed in interface TimerListenersender - The timer whose delay period elapsed. The listener should be registered to this timer.Copyright © 2004–2016 XWiki. All rights reserved.