Class ResettableOneOffLatch


  • public final class ResettableOneOffLatch
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ResettableOneOffLatch()
      Initializes this latch in an 'unlatched' mode.
      ResettableOneOffLatch​(boolean latched)
      Initializes this latch in either 'latched' or 'unlatched' mode.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void await​(boolean reset)
      Wait for this latch to fire, optionally resetting it fires.
      void fire()
      Unlatches this latch, moving it to an unlatched mode.
      void reset()
      Reset this latch back to a 'latched' state, irregardless of its current state.
      • Methods inherited from class java.lang.Object

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

      • ResettableOneOffLatch

        public ResettableOneOffLatch()
        Initializes this latch in an 'unlatched' mode.
      • ResettableOneOffLatch

        public ResettableOneOffLatch​(boolean latched)
        Initializes this latch in either 'latched' or 'unlatched' mode.
        Parameters:
        latched - Setting this to true instantiates this class in a 'latched' mode, requiring an initial call to fire() in order to unlatch
    • Method Detail

      • reset

        public void reset()
        Reset this latch back to a 'latched' state, irregardless of its current state.
      • fire

        public void fire()
        Unlatches this latch, moving it to an unlatched mode.
      • await

        public void await​(boolean reset)
        Wait for this latch to fire, optionally resetting it fires.
        Parameters:
        reset - whether or not to reset this latch after it fires