Klasse BooleanAsyncBuilder.BaseBooleanTask

java.lang.Object
speiger.src.collections.booleans.utils.BooleanAsyncBuilder.BaseBooleanTask
Alle implementierten Schnittstellen:
Runnable, Future<Boolean>, RunnableFuture<Boolean>, BooleanTask
Umschließende Klasse:
BooleanAsyncBuilder

public abstract static class BooleanAsyncBuilder.BaseBooleanTask extends Object implements BooleanTask
Base Task of the Actions that can be performed. Allows to simplify the actions that get executed.
  • Verschachtelte Klassen - Übersicht

    Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen java.util.concurrent.Future

    Future.State
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    void
    Pauses the task, which lets the thread finish without completing the task.
    boolean
    cancel(boolean cancelIfRunnning)
     
    boolean
    A Type Specific get method that allows to reduce (un)boxing of primtives.
    boolean
    getBoolean(long timeout, TimeUnit unit)
    Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
    boolean
     
    boolean
     
    boolean
    Helper function to detect if the task is currently paused.
    boolean
    Quality of life function that allows to detect if no cancellation/exception was applied to this task and it completed on its own.
    void
    Pauses the task, which lets the thread finish without completing the task.
    void
    Continues the task if it wasn't already completed.
    void
    run()
     

    Von Klasse geerbte Methoden java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Von Schnittstelle geerbte Methoden speiger.src.collections.booleans.functions.BooleanTask

    get, get

    Von Schnittstelle geerbte Methoden java.util.concurrent.Future

    exceptionNow, resultNow, state
  • Konstruktordetails

    • BaseBooleanTask

      public BaseBooleanTask()
  • Methodendetails

    • run

      public void run()
      Angegeben von:
      run in Schnittstelle Runnable
      Angegeben von:
      run in Schnittstelle RunnableFuture<Boolean>
    • cancel

      public boolean cancel(boolean cancelIfRunnning)
      Angegeben von:
      cancel in Schnittstelle Future<Boolean>
    • getBoolean

      public boolean getBoolean() throws InterruptedException, ExecutionException
      Beschreibung aus Schnittstelle kopiert: BooleanTask
      A Type Specific get method that allows to reduce (un)boxing of primtives. Waits if necessary for the computation to complete, and then retrieves its result.
      Angegeben von:
      getBoolean in Schnittstelle BooleanTask
      Gibt zurück:
      the computed result as primitive
      Löst aus:
      InterruptedException - if the current thread was interrupted while waiting
      ExecutionException - if the computation threw an exception
    • getBoolean

      public boolean getBoolean(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
      Beschreibung aus Schnittstelle kopiert: BooleanTask
      Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
      Angegeben von:
      getBoolean in Schnittstelle BooleanTask
      Parameter:
      timeout - the maximum time to wait
      unit - the time unit of the timeout argument
      Gibt zurück:
      the computed result as primitive
      Löst aus:
      InterruptedException - if the current thread was interrupted while waiting
      ExecutionException - if the computation threw an exception
      TimeoutException - if the wait timed out
    • isCancelled

      public boolean isCancelled()
      Angegeben von:
      isCancelled in Schnittstelle Future<Boolean>
    • isDone

      public boolean isDone()
      Angegeben von:
      isDone in Schnittstelle Future<Boolean>
    • isPaused

      public boolean isPaused()
      Beschreibung aus Schnittstelle kopiert: BooleanTask
      Helper function to detect if the task is currently paused.
      Angegeben von:
      isPaused in Schnittstelle BooleanTask
      Gibt zurück:
      true if paused
    • isSuccessful

      public boolean isSuccessful()
      Beschreibung aus Schnittstelle kopiert: BooleanTask
      Quality of life function that allows to detect if no cancellation/exception was applied to this task and it completed on its own.
      Angegeben von:
      isSuccessful in Schnittstelle BooleanTask
      Gibt zurück:
      true if it was properly completed
    • pause

      public void pause()
      Beschreibung aus Schnittstelle kopiert: BooleanTask
      Pauses the task, which lets the thread finish without completing the task. Tasks are written in the way where they can pause without any issues. This won't be instant, as this function is applied asynchronous and doesn't check if the thread paused. So make sure it had the time to pause.
      Angegeben von:
      pause in Schnittstelle BooleanTask
    • awaitPausing

      public void awaitPausing()
      Beschreibung aus Schnittstelle kopiert: BooleanTask
      Pauses the task, which lets the thread finish without completing the task. Tasks are written in the way where they can pause without any issues. This won't be instant, as this function is applied asynchronous. It will await the pausing of the task.
      Angegeben von:
      awaitPausing in Schnittstelle BooleanTask
    • resume

      public void resume()
      Beschreibung aus Schnittstelle kopiert: BooleanTask
      Continues the task if it wasn't already completed. This is done by resubmitting the task to the executor provided.
      Angegeben von:
      resume in Schnittstelle BooleanTask