public class TLspTaskExecutorRunnable extends Object implements Runnable
Specifies the task that must be performed by a runnable. Apart from delegating to
a Runnable
object, this class also holds
additional information regarding the task to be scheduled.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_MESSAGE
Default message passed to the
invalidate
when execution of the runnable requires a view invalidation. |
static int |
DEFAULT_PRIORITY
Default priority hint of 0.
|
Constructor and Description |
---|
TLspTaskExecutorRunnable(Object aSource,
Runnable aRunnable,
boolean aNewPaintAvailable)
Creates a new task executor runnable with the given parameters and a
default priority hint . |
TLspTaskExecutorRunnable(Object aSource,
Runnable aRunnable,
int aPriority,
boolean aNewPaintAvailable)
Creates a new task executor runnable with the given parameters.
|
TLspTaskExecutorRunnable(Object aSource,
Runnable aRunnable,
int aPriority,
boolean aNewPaintAvailable,
long aDelay,
TimeUnit aDelayUnit)
Creates a new task executor runnable with the given parameters.
|
Modifier and Type | Method and Description |
---|---|
long |
getDelay()
Returns the delay before the task should be executed.
|
TimeUnit |
getDelayUnit()
Returns the unit for the
delay . |
String |
getMessage()
Message passed when invalidating the view when
isNewPaintAvailable() is true
after running the runnable. |
int |
getPriority()
The priority hint of the runnable.
|
Runnable |
getRunnable()
Returns the delegate runnable.
|
Object |
getSource()
Returns the source object that scheduled the runnable.
|
boolean |
isNewPaintAvailable()
Returns whether or not the execution of this runnable results in a change in the view.
|
void |
run() |
String |
toString() |
public static final int DEFAULT_PRIORITY
public static final String DEFAULT_MESSAGE
invalidate
when execution of the runnable requires a view invalidation.public TLspTaskExecutorRunnable(Object aSource, Runnable aRunnable, boolean aNewPaintAvailable)
default priority hint
.aSource
- The source object that scheduled the runnableaRunnable
- A delegate runnable. This runnable is not allowed to repaint the view. Instead
the aNewPaintAvailable
should be set to true.aNewPaintAvailable
- If true, hints that executing this task will result in
a change in the view in any way. If false, this task
has no impact on visualisation.public TLspTaskExecutorRunnable(Object aSource, Runnable aRunnable, int aPriority, boolean aNewPaintAvailable)
aSource
- The source object that scheduled the runnableaRunnable
- A delegate runnable. This runnable is not allowed to repaint the view. Instead
the aNewPaintAvailable
should be set to true.aPriority
- The priority of the runnable, where a higher value translates
to a higher priority. Note that the priority is a hint - task executor implementations
are not required to take this into account.aNewPaintAvailable
- If true, hints that executing this task will result in
a change in the view in any way. If false, this task
has no impact on visualisation.public TLspTaskExecutorRunnable(Object aSource, Runnable aRunnable, int aPriority, boolean aNewPaintAvailable, long aDelay, TimeUnit aDelayUnit)
aSource
- The source object that scheduled the runnableaRunnable
- A delegate runnable. This runnable is not allowed to repaint the view. Instead
the aNewPaintAvailable
should be set to true.aPriority
- The priority of the runnable, where a higher value translates
to a higher priority. Note that the priority is a hint - task executor implementations
are not required to take this into account.aNewPaintAvailable
- If true, hints that executing this task will result in
a change in the view in any way. If false, this task
has no impact on visualisation.aDelay
- The delay before the task should be executed. Zero indicates that the
task may be executed immediately. The delay is a hint, no guarantee.aDelayUnit
- The unit of aDelay
public Runnable getRunnable()
public boolean isNewPaintAvailable()
public int getPriority()
public Object getSource()
public long getDelay()
getDelayUnit()
public String getMessage()
isNewPaintAvailable()
is true
after running the runnable. The message is used for tracing.
By default this method returns DEFAULT_MESSAGE
.
invalidate
method for tracing purposes