Klasse ObjectAsyncBuilder.BaseObjectTask<T>

java.lang.Object
speiger.src.collections.objects.utils.ObjectAsyncBuilder.BaseObjectTask<T>
Typparameter:
T - the keyType of elements maintained by this Collection
Alle implementierten Schnittstellen:
Runnable, Future<T>, RunnableFuture<T>, ObjectTask<T>
Umschließende Klasse:
ObjectAsyncBuilder<T>

public abstract static class ObjectAsyncBuilder.BaseObjectTask<T> extends Object implements ObjectTask<T>
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)
     
    get()
     
    get(long timeout, TimeUnit unit)
     
    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 java.util.concurrent.Future

    exceptionNow, resultNow, state
  • Konstruktordetails

    • BaseObjectTask

      public BaseObjectTask()
  • Methodendetails

    • run

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

      public boolean cancel(boolean cancelIfRunnning)
      Angegeben von:
      cancel in Schnittstelle Future<T>
    • get

      Angegeben von:
      get in Schnittstelle Future<T>
      Löst aus:
      InterruptedException
      ExecutionException
    • get

      public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
      Angegeben von:
      get in Schnittstelle Future<T>
      Löst aus:
      InterruptedException
      ExecutionException
      TimeoutException
    • isCancelled

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

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

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

      public boolean isSuccessful()
      Beschreibung aus Schnittstelle kopiert: ObjectTask
      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 ObjectTask<T>
      Gibt zurück:
      true if it was properly completed
    • pause

      public void pause()
      Beschreibung aus Schnittstelle kopiert: ObjectTask
      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 ObjectTask<T>
    • awaitPausing

      public void awaitPausing()
      Beschreibung aus Schnittstelle kopiert: ObjectTask
      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 ObjectTask<T>
    • resume

      public void resume()
      Beschreibung aus Schnittstelle kopiert: ObjectTask
      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 ObjectTask<T>