Class Flag

java.lang.Object
com.jozufozu.flywheel.lib.task.Flag
Direct Known Subclasses:
NamedFlag, StageFlag

public class Flag extends Object
A flag that can be raised and lowered in a thread-safe fashion.
Useful when combined with RaisePlan and TaskExecutor.syncUntil.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Check if this flag is lowered.
    boolean
    Check if this flag is raised.
    void
    Lower this flag that may have been previously raised.
    void
    Raise this flag indicating a key point in execution.

    Methods inherited from class java.lang.Object

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

    • Flag

      public Flag()
  • Method Details

    • raise

      public void raise()
      Raise this flag indicating a key point in execution.
      If the flag was already raised, this method does nothing.
    • lower

      public void lower()
      Lower this flag that may have been previously raised.
      If the flag was never raised, this method does nothing.
    • isRaised

      public boolean isRaised()
      Check if this flag is raised.
      Returns:
      true if the flag is raised.
    • isLowered

      public boolean isLowered()
      Check if this flag is lowered.
      Returns:
      true if the flag is lowered.