Class BlackHoleWorkState<V>

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

public class BlackHoleWorkState<V> extends Object implements WorkState<V>
This work state does not update its properties, except for isCancelled(). This allows to use this work state, when the FX Application Thread is not running.
  • Property Summary

    Properties
    Type
    Property
    Description
    javafx.beans.property.ReadOnlyObjectProperty<Throwable>
     
    javafx.beans.property.ReadOnlyStringProperty
     
    javafx.beans.property.ReadOnlyDoubleProperty
     
    javafx.beans.property.ReadOnlyBooleanProperty
     
    javafx.beans.property.ReadOnlyObjectProperty<javafx.concurrent.Worker.State>
     
    javafx.beans.property.ReadOnlyStringProperty
     
    javafx.beans.property.ReadOnlyDoubleProperty
     
    javafx.beans.property.ReadOnlyObjectProperty<V>
     
    javafx.beans.property.ReadOnlyDoubleProperty
     
  • Nested Class Summary

    Nested classes/interfaces inherited from interface javafx.concurrent.Worker

    javafx.concurrent.Worker.State
  • Field Summary

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    javafx.beans.property.ReadOnlyObjectProperty<Throwable>
     
    @Nullable Throwable
    Gets the value of the exception property.
    @Nullable String
    Gets the value of the message property.
    double
    Gets the value of the progress property.
    javafx.concurrent.Worker.State
    Gets the value of the state property.
    @Nullable String
    Gets the value of the title property.
    double
    Gets the value of the totalWork property.
    @Nullable V
    Gets the value of the value property.
    double
    Gets the value of the workDone property.
    boolean
    Returns true if the worker associated to this work state should cancel.
    boolean
    Gets the value of the running property.
    javafx.beans.property.ReadOnlyStringProperty
     
    javafx.beans.property.ReadOnlyDoubleProperty
     
    javafx.beans.property.ReadOnlyBooleanProperty
     
    javafx.beans.property.ReadOnlyObjectProperty<javafx.concurrent.Worker.State>
     
    javafx.beans.property.ReadOnlyStringProperty
     
    javafx.beans.property.ReadOnlyDoubleProperty
     
    void
    Asynchronously updates the current exception of the work state.
    void
    updateMessage(@Nullable String value)
    Does nothing, because this implementation does not require that the FX Application Thread is running.
    void
    updateProgress(double value)
    Does nothing, because this implementation does not require that the FX Application Thread is running.
    void
    updateRunning(boolean value)
    Asynchronously updates the current running state of the work state.
    void
    updateState(javafx.concurrent.Worker.State value)
    Asynchronously updates the current state of the work state.
    void
    updateTitle(@Nullable String value)
    Does nothing, because this implementation does not require that the FX Application Thread is running.
    void
    updateValue(@Nullable Object value)
    Does nothing, because this implementation does not require that the FX Application Thread is running.
    javafx.beans.property.ReadOnlyObjectProperty<V>
     
    javafx.beans.property.ReadOnlyDoubleProperty
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Property Details

  • Constructor Details

    • BlackHoleWorkState

      public BlackHoleWorkState()
  • Method Details

    • updateMessage

      public void updateMessage(@Nullable String value)
      Does nothing, because this implementation does not require that the FX Application Thread is running.
      Specified by:
      updateMessage in interface WorkState<V>
      Parameters:
      value - the new value
    • updateState

      public void updateState(javafx.concurrent.Worker.State value)
      Description copied from interface: WorkState
      Asynchronously updates the current state of the work state.

      Calls to this method are coalesced as described in WorkState.updateMessage(String).

      Specified by:
      updateState in interface WorkState<V>
      Parameters:
      value - the new value
    • updateException

      public void updateException(Throwable value)
      Description copied from interface: WorkState
      Asynchronously updates the current exception of the work state.

      Calls to this method are coalesced as described in WorkState.updateMessage(String).

      Specified by:
      updateException in interface WorkState<V>
      Parameters:
      value - the new value
    • updateRunning

      public void updateRunning(boolean value)
      Description copied from interface: WorkState
      Asynchronously updates the current running state of the work state.

      Calls to this method are coalesced as described in WorkState.updateMessage(String).

      Specified by:
      updateRunning in interface WorkState<V>
      Parameters:
      value - the new value
    • updateTitle

      public void updateTitle(@Nullable String value)
      Does nothing, because this implementation does not require that the FX Application Thread is running.
      Specified by:
      updateTitle in interface WorkState<V>
      Parameters:
      value - the new value
    • updateValue

      public void updateValue(@Nullable Object value)
      Does nothing, because this implementation does not require that the FX Application Thread is running.
      Specified by:
      updateValue in interface WorkState<V>
      Parameters:
      value - the new value
    • updateProgress

      public void updateProgress(double value)
      Does nothing, because this implementation does not require that the FX Application Thread is running.
      Specified by:
      updateProgress in interface WorkState<V>
      Parameters:
      value - the new value
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: WorkState
      Returns true if the worker associated to this work state should cancel.
      Specified by:
      isCancelled in interface WorkState<V>
      Returns:
      true if cancelled
    • 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:
    • getValue

      public @Nullable V getValue()
      Gets the value of the value property.
      Specified by:
      getValue in interface javafx.concurrent.Worker<V>
      Specified by:
      getValue in interface WorkState<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>
      Specified by:
      valueProperty in interface WorkState<V>
      Returns:
      the value property
      See Also:
    • getException

      public @Nullable 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>
      Specified by:
      getWorkDone in interface WorkState<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>
      Specified by:
      workDoneProperty in interface WorkState<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>
      Specified by:
      getTotalWork in interface WorkState<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>
      Specified by:
      totalWorkProperty in interface WorkState<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>
      Specified by:
      getProgress in interface WorkState<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>
      Specified by:
      progressProperty in interface WorkState<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 @Nullable String getMessage()
      Gets the value of the message property.
      Specified by:
      getMessage in interface javafx.concurrent.Worker<V>
      Specified by:
      getMessage in interface WorkState<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>
      Specified by:
      messageProperty in interface WorkState<V>
      Returns:
      the message property
      See Also:
    • getTitle

      public @Nullable String getTitle()
      Gets the value of the title property.
      Specified by:
      getTitle in interface javafx.concurrent.Worker<V>
      Specified by:
      getTitle in interface WorkState<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>
      Specified by:
      titleProperty in interface WorkState<V>
      Returns:
      the title property
      See Also:
    • cancel

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