Class TLspTaskExecutorRunnable
java.lang.Object
com.luciad.view.lightspeed.services.asynchronous.TLspTaskExecutorRunnable
- All Implemented Interfaces:
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.
- Since:
- 2012.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default message passed to theinvalidate
when execution of the runnable requires a view invalidation.static final int
Default priority hint of 0. -
Constructor Summary
ConstructorDescriptionTLspTaskExecutorRunnable
(Object aSource, Runnable aRunnable, boolean aNewPaintAvailable) Creates a new task executor runnable with the given parameters and adefault 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. -
Method Summary
Modifier and TypeMethodDescriptionlong
getDelay()
Returns the delay before the task should be executed.Returns the unit for thedelay
.Message passed when invalidating the view whenisNewPaintAvailable()
istrue
after running the runnable.int
The priority hint of the runnable.Returns the delegate runnable.Returns the source object that scheduled the runnable.boolean
Returns whether or not the execution of this runnable results in a change in the view.void
run()
toString()
-
Field Details
-
DEFAULT_PRIORITY
public static final int DEFAULT_PRIORITYDefault priority hint of 0.- See Also:
-
DEFAULT_MESSAGE
Default message passed to theinvalidate
when execution of the runnable requires a view invalidation.- See Also:
-
-
Constructor Details
-
TLspTaskExecutorRunnable
Creates a new task executor runnable with the given parameters and adefault priority hint
.- Parameters:
aSource
- The source object that scheduled the runnableaRunnable
- A delegate runnable. This runnable is not allowed to repaint the view. Instead theaNewPaintAvailable
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.
-
TLspTaskExecutorRunnable
public TLspTaskExecutorRunnable(Object aSource, Runnable aRunnable, int aPriority, boolean aNewPaintAvailable) Creates a new task executor runnable with the given parameters.- Parameters:
aSource
- The source object that scheduled the runnableaRunnable
- A delegate runnable. This runnable is not allowed to repaint the view. Instead theaNewPaintAvailable
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.
-
TLspTaskExecutorRunnable
public TLspTaskExecutorRunnable(Object aSource, Runnable aRunnable, int aPriority, boolean aNewPaintAvailable, long aDelay, TimeUnit aDelayUnit) Creates a new task executor runnable with the given parameters.- Parameters:
aSource
- The source object that scheduled the runnableaRunnable
- A delegate runnable. This runnable is not allowed to repaint the view. Instead theaNewPaintAvailable
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 ofaDelay
-
-
Method Details
-
run
public void run() -
getRunnable
Returns the delegate runnable.- Returns:
- the delegate runnable
-
isNewPaintAvailable
public boolean isNewPaintAvailable()Returns whether or not the execution of this runnable results in a change in the view.- Returns:
- whether or not the execution of this runnable results in a change in the view
-
getPriority
public int getPriority()The priority hint of the runnable. A higher value corresponds to a higher priority. Note that task executor implementations are not required to take this into account.- Returns:
- the priority hint of the runnable
-
getSource
Returns the source object that scheduled the runnable.- Returns:
- the source object that scheduled the runnable
-
getDelay
public long getDelay()Returns the delay before the task should be executed. Note that the delay is a hint, no guarantee.- Returns:
- the delay in
getDelayUnit()
-
getDelayUnit
Returns the unit for thedelay
.- Returns:
- the unit
-
getMessage
Message passed when invalidating the view whenisNewPaintAvailable()
istrue
after running the runnable. The message is used for tracing.By default this method returns
DEFAULT_MESSAGE
.- Returns:
- a message used to pass to the view's
invalidate
method for tracing purposes
-
toString
-