Class PausingAwaitableNoOpRunnable

    • Constructor Detail

      • PausingAwaitableNoOpRunnable

        public PausingAwaitableNoOpRunnable()
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface Runnable
      • awaitTaskCompletion

        public boolean awaitTaskCompletion​(long amount,
                                           TimeUnit unit)
                                    throws InterruptedException
        Description copied from interface: AwaitableRunnable
        Block until the task has finished running, or until a timeout has expired.
        Specified by:
        awaitTaskCompletion in interface AwaitableRunnable
        Parameters:
        amount - The duration of the timeout.
        unit - The units of the amount parameter.
        Returns:
        True if the task completed before the timeout expired; false if it did not.
        Throws:
        InterruptedException - If the thread was interrupted while waiting.
      • hasPaused

        public boolean hasPaused()
        Description copied from interface: PausingRunnable
        Has the PausingRunnable paused yet? If it has been unpaused this will also return true.
        Specified by:
        hasPaused in interface PausingRunnable
        Returns:
        true if it is paused, or was previously paused and has been unpaused.
      • waitUntilPaused

        public boolean waitUntilPaused​(long amount,
                                       TimeUnit unit)
                                throws InterruptedException
        Description copied from interface: PausingRunnable
        Block the current thread until the PausingRunnable is paused, unless a timeout has expired while waiting. If the timeout expires, this method will return false.
        Specified by:
        waitUntilPaused in interface PausingRunnable
        Parameters:
        amount - The magnitude of the timeout value.
        unit - The units of the timeout value.
        Returns:
        true if the PausingRunnable paused before the timeout expired, or false if the timeout expired before the PausingRunnable paused.
        Throws:
        InterruptedException - if the thread that is waiting is interrupted.
      • unpause

        public void unpause()
        Description copied from interface: PausingRunnable
        Release a paused PausingRunnable so that it can continue running.
        Specified by:
        unpause in interface PausingRunnable
      • hasUnpaused

        public boolean hasUnpaused()
        Description copied from interface: PausingRunnable
        Has the PausingRunnable been paused and then unpaused?
        Specified by:
        hasUnpaused in interface PausingRunnable
        Returns:
        true if it has been unpaused.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object