Class SimpleCompletableWorker<V>

java.lang.Object
org.jhotdraw8.fxbase.concurrent.SimpleCompletableWorker<V>
Type Parameters:
V - the result type
All Implemented Interfaces:
javafx.concurrent.Worker<V>, CompletableWorker<V>

public class SimpleCompletableWorker<V> extends Object implements CompletableWorker<V>
Simple implementation of CompletableWorker.
  • Property Details

    • state

      public javafx.beans.property.ReadOnlyObjectProperty<javafx.concurrent.Worker.State> stateProperty
      Specified by:
      stateProperty in interface javafx.concurrent.Worker<V>
      See Also:
    • value

      public javafx.beans.property.ReadOnlyObjectProperty<V> valueProperty
      Specified by:
      valueProperty in interface javafx.concurrent.Worker<V>
      See Also:
    • exception

      public javafx.beans.property.ReadOnlyObjectProperty<Throwable> exceptionProperty
      Specified by:
      exceptionProperty in interface javafx.concurrent.Worker<V>
      See Also:
    • workDone

      public javafx.beans.property.ReadOnlyDoubleProperty workDoneProperty
      Specified by:
      workDoneProperty in interface javafx.concurrent.Worker<V>
      See Also:
    • totalWork

      public javafx.beans.property.ReadOnlyDoubleProperty totalWorkProperty
      Specified by:
      totalWorkProperty in interface javafx.concurrent.Worker<V>
      See Also:
    • progress

      public javafx.beans.property.ReadOnlyDoubleProperty progressProperty
      Specified by:
      progressProperty in interface javafx.concurrent.Worker<V>
      See Also:
    • running

      public javafx.beans.property.ReadOnlyBooleanProperty runningProperty
      Specified by:
      runningProperty in interface javafx.concurrent.Worker<V>
      See Also:
    • message

      public javafx.beans.property.ReadOnlyStringProperty messageProperty
      Specified by:
      messageProperty in interface javafx.concurrent.Worker<V>
      See Also:
    • title

      public javafx.beans.property.ReadOnlyStringProperty titleProperty
      Specified by:
      titleProperty in interface javafx.concurrent.Worker<V>
      See Also:
  • Constructor Details

    • SimpleCompletableWorker

      public SimpleCompletableWorker(WorkState<V> workState)
  • Method Details

    • getCompletionStage

      public CompletionStage<V> getCompletionStage()
      Description copied from interface: CompletableWorker
      Returns the completion stage of this worker.

      The completion stage completes (or fails) on the fxApplicationThread when this worker is set to one of the following states:

      • Worker.State.FAILED
      • Worker.State.SUCCEEDED
      Specified by:
      getCompletionStage in interface CompletableWorker<V>
      Returns:
    • getState

      public javafx.concurrent.Worker.State getState()
      Gets the value of the state property.
      Specified by:
      getState in interface javafx.concurrent.Worker<V>
      Property description:
      Returns:
      the value of the state property
      See Also:
    • stateProperty

      public javafx.beans.property.ReadOnlyObjectProperty<javafx.concurrent.Worker.State> stateProperty()
      Specified by:
      stateProperty in interface javafx.concurrent.Worker<V>
      Returns:
      the state property
      See Also:
    • updateState

      public void updateState(javafx.concurrent.Worker.State newValue)
      This method may be called on any thread.
      Parameters:
      newValue - the new value
    • getValue

      public V getValue()
      Gets the value of the value property.
      Specified by:
      getValue in interface javafx.concurrent.Worker<V>
      Property description:
      Returns:
      the value of the value property
      See Also:
    • valueProperty

      public javafx.beans.property.ReadOnlyObjectProperty<V> valueProperty()
      Specified by:
      valueProperty in interface javafx.concurrent.Worker<V>
      Returns:
      the value property
      See Also:
    • getException

      public Throwable getException()
      Gets the value of the exception property.
      Specified by:
      getException in interface javafx.concurrent.Worker<V>
      Property description:
      Returns:
      the value of the exception property
      See Also:
    • exceptionProperty

      public javafx.beans.property.ReadOnlyObjectProperty<Throwable> exceptionProperty()
      Specified by:
      exceptionProperty in interface javafx.concurrent.Worker<V>
      Returns:
      the exception property
      See Also:
    • getWorkDone

      public double getWorkDone()
      Gets the value of the workDone property.
      Specified by:
      getWorkDone in interface javafx.concurrent.Worker<V>
      Property description:
      Returns:
      the value of the workDone property
      See Also:
    • workDoneProperty

      public javafx.beans.property.ReadOnlyDoubleProperty workDoneProperty()
      Specified by:
      workDoneProperty in interface javafx.concurrent.Worker<V>
      Returns:
      the workDone property
      See Also:
    • getTotalWork

      public double getTotalWork()
      Gets the value of the totalWork property.
      Specified by:
      getTotalWork in interface javafx.concurrent.Worker<V>
      Property description:
      Returns:
      the value of the totalWork property
      See Also:
    • totalWorkProperty

      public javafx.beans.property.ReadOnlyDoubleProperty totalWorkProperty()
      Specified by:
      totalWorkProperty in interface javafx.concurrent.Worker<V>
      Returns:
      the totalWork property
      See Also:
    • getProgress

      public double getProgress()
      Gets the value of the progress property.
      Specified by:
      getProgress in interface javafx.concurrent.Worker<V>
      Property description:
      Returns:
      the value of the progress property
      See Also:
    • progressProperty

      public javafx.beans.property.ReadOnlyDoubleProperty progressProperty()
      Specified by:
      progressProperty in interface javafx.concurrent.Worker<V>
      Returns:
      the progress property
      See Also:
    • isRunning

      public boolean isRunning()
      Gets the value of the running property.
      Specified by:
      isRunning in interface javafx.concurrent.Worker<V>
      Property description:
      Returns:
      the value of the running property
      See Also:
    • runningProperty

      public javafx.beans.property.ReadOnlyBooleanProperty runningProperty()
      Specified by:
      runningProperty in interface javafx.concurrent.Worker<V>
      Returns:
      the running property
      See Also:
    • getMessage

      public String getMessage()
      Gets the value of the message property.
      Specified by:
      getMessage in interface javafx.concurrent.Worker<V>
      Property description:
      Returns:
      the value of the message property
      See Also:
    • messageProperty

      public javafx.beans.property.ReadOnlyStringProperty messageProperty()
      Specified by:
      messageProperty in interface javafx.concurrent.Worker<V>
      Returns:
      the message property
      See Also:
    • getTitle

      public String getTitle()
      Gets the value of the title property.
      Specified by:
      getTitle in interface javafx.concurrent.Worker<V>
      Property description:
      Returns:
      the value of the title property
      See Also:
    • titleProperty

      public javafx.beans.property.ReadOnlyStringProperty titleProperty()
      Specified by:
      titleProperty in interface javafx.concurrent.Worker<V>
      Returns:
      the title property
      See Also:
    • cancel

      public boolean cancel()
      Specified by:
      cancel in interface javafx.concurrent.Worker<V>
    • updateException

      public void updateException(Throwable value)
    • complete

      public void complete(V result)
      Specified by:
      complete in interface CompletableWorker<V>
    • completeExceptionally

      public void completeExceptionally(Throwable exception)
      Specified by:
      completeExceptionally in interface CompletableWorker<V>