Class Event

java.lang.Object
com.diozero.util.Event

public class Event
extends java.lang.Object
  • Constructor Summary

    Constructors 
    Constructor Description
    Event()  
  • Method Summary

    Modifier and Type Method Description
    void clear()  
    boolean doWait()
    Wait indefinitely for set() to be called.
    boolean doWait​(int timeout)
    Wait the specified time period for set() to be called.
    void set()  

    Methods inherited from class java.lang.Object

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

  • Method Details

    • doWait

      public boolean doWait() throws java.lang.InterruptedException
      Wait indefinitely for set() to be called.
      Returns:
      True if set() was called, false woken unexpectedly.
      Throws:
      java.lang.InterruptedException - If interrupted.
    • doWait

      public boolean doWait​(int timeout) throws java.lang.InterruptedException
      Wait the specified time period for set() to be called.
      Parameters:
      timeout - Timeout value in milliseconds.
      Returns:
      True if set() was called, false if timed out waiting.
      Throws:
      java.lang.InterruptedException - If interrupted.
    • set

      public void set()
    • clear

      public void clear()