java.lang.Object | |
↳ | sun.swing.AccumulativeRunnable<T> |
An abstract class to be used in the cases where we need Runnable
to perform some actions on an appendable set of data.
The set of data might be appended after the Runnable
is
sent for the execution. Usually such Runnables
are sent to
the EDT.
Usage example:
Say we want to implement JLabel.setText(String text) which sends
text
string to the JLabel.setTextImpl(String text) on the EDT.
In the event JLabel.setText is called rapidly many times off the EDT
we will get many updates on the EDT but only the last one is important.
(Every next updates overrides the previous one.)
We might want to implement this setText
in a way that only
the last update is delivered.
Here is how one can do this using AccumulativeRunnable
:
AccumulativeRunnabledoSetTextImpl = new AccumulativeRunnable () {
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
appends arguments and sends this {@cod Runnable} for the
execution if needed.
| |||||||||||
When an object implementing interface
Runnable is used
to create a thread, starting the thread causes the object's
run method to be called in that separately executing
thread.
This implementation calls |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Equivalent to
Runnable.run method with the
accumulated arguments to process. | |||||||||||
Sends this
Runnable for the execution
This method is to be executed only from |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
appends arguments and sends this {@cod Runnable} for the execution if needed.
This implementation uses to send this
Runnable
for execution.
args | the arguments to accumulate |
---|
When an object implementing interface Runnable
is used
to create a thread, starting the thread causes the object's
run
method to be called in that separately executing
thread.
The general contract of the method run
is that it may
take any action whatsoever.
This implementation calls run(List<T> args)
mehtod
with the list of accumulated arguments.
Equivalent to Runnable.run
method with the
accumulated arguments to process.
args | accumulated argumets to process. |
---|
Sends this Runnable
for the execution
This method is to be executed only from add
method.
This implementation uses SwingWorker.invokeLater
.