public class UpdateRunner
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.ConcurrentLinkedQueue<java.lang.Runnable> |
queue
The queue of pending updates
|
private java.lang.Object |
sync
Owner/Synchronization object
|
private UpdateSynchronizer |
synchronizer
Synchronizer that can block events from being executed right away.
|
Modifier | Constructor and Description |
---|---|
protected |
UpdateRunner(java.lang.Object sync)
Construct a new update handler
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear queue.
|
void |
invokeLater(java.lang.Runnable r)
Add a new update to run at any appropriate time.
|
boolean |
isEmpty()
Check whether the queue is empty.
|
void |
runQueue()
Run the processing queue now.
|
void |
synchronizeWith(UpdateSynchronizer newsync)
Set a new update synchronizer.
|
void |
unsynchronizeWith(UpdateSynchronizer oldsync)
Remove an update synchronizer
|
private java.lang.Object sync
private final java.util.concurrent.ConcurrentLinkedQueue<java.lang.Runnable> queue
private UpdateSynchronizer synchronizer
protected UpdateRunner(java.lang.Object sync)
sync
- Object to synchronize onpublic void invokeLater(java.lang.Runnable r)
r
- New runnable to perform the updatepublic void runQueue()
public void clear()
public boolean isEmpty()
public void synchronizeWith(UpdateSynchronizer newsync)
newsync
- Update synchronizerpublic void unsynchronizeWith(UpdateSynchronizer oldsync)
oldsync
- Update synchronizer to removeCopyright © 2019 ELKI Development Team. License information.