Class TLspTaskExecutorRunnable

java.lang.Object
com.luciad.view.lightspeed.services.asynchronous.TLspTaskExecutorRunnable
All Implemented Interfaces:
Runnable

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.

Since:
2012.0
  • Field Details

    • DEFAULT_PRIORITY

      public static final int DEFAULT_PRIORITY
      Default priority hint of 0.
      See Also:
    • DEFAULT_MESSAGE

      public static final String DEFAULT_MESSAGE
      Default message passed to the invalidate when execution of the runnable requires a view invalidation.
      See Also:
  • Constructor Details

    • TLspTaskExecutorRunnable

      public TLspTaskExecutorRunnable(Object aSource, Runnable aRunnable, boolean aNewPaintAvailable)
      Creates a new task executor runnable with the given parameters and a default priority hint.
      Parameters:
      aSource - The source object that scheduled the runnable
      aRunnable - 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.
    • 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 runnable
      aRunnable - 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.
    • 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 runnable
      aRunnable - 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
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • getRunnable

      public Runnable 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

      public Object 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

      public TimeUnit getDelayUnit()
      Returns the unit for the delay.
      Returns:
      the unit
    • getMessage

      public String getMessage()
      Message passed when invalidating the view when isNewPaintAvailable() is true 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

      public String toString()
      Overrides:
      toString in class Object