Package net.sf.gridarta.utils
Class DelayedChangeManager
- java.lang.Object
-
- net.sf.gridarta.utils.DelayedChangeManager
-
public class DelayedChangeManager extends java.lang.ObjectHelper for reducing the number of change events: calls tochange()will be forwarded toDelayedChangeListener.change(). Forwarded calls are dropped if they would happen very quickly.
-
-
Constructor Summary
Constructors Constructor Description DelayedChangeManager(int initialDelay, int notificationDelay, @NotNull DelayedChangeListener delayedChangeListener)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchange()Delivers a change event to the associatedDelayedChangeListener.voidfinish()Finishes a series ofchangeevents.
-
-
-
Constructor Detail
-
DelayedChangeManager
public DelayedChangeManager(int initialDelay, int notificationDelay, @NotNull @NotNull DelayedChangeListener delayedChangeListener)Creates a new instance.- Parameters:
initialDelay- the initial delay for a series of events in millisecondsnotificationDelay- the delay for following events in a series of events; in millisecondsdelayedChangeListener- the delayed change listener to forward events to
-
-
Method Detail
-
change
public void change()
Delivers a change event to the associatedDelayedChangeListener.
-
finish
public void finish()
Finishes a series ofchangeevents. Calling this function is optional: if it is called, a pending change event is immediately forwarded; otherwise when the notification timeout has expired.
-
-