Back to Exoplayer

RunnableFutureTask (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/util/RunnableFutureTask.html

latest6.4 KB
Original Source

Package com.google.android.exoplayer2.util

Class RunnableFutureTask<R,​E extends Exception>

  • java.lang.Object

    • com.google.android.exoplayer2.util.RunnableFutureTask<R,​E>
  • Type Parameters:R - The type of the result.E - The type of any ExecutionException cause.All Implemented Interfaces:Runnable, Future<R>, RunnableFuture<R>


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public abstract classRunnableFutureTask\<R,​E extends [Exception](https://developer.android.com/reference/java/lang/Exception.html "class or interface in java.lang")\>extends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[RunnableFuture](https://developer.android.com/reference/java/util/concurrent/RunnableFuture.html "class or interface in java.util.concurrent")<R>

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

A RunnableFuture that supports additional uninterruptible operations to query whether execution has started and finished.

Constructor Summary

Constructors | Modifier | Constructor | Description | | --- | --- | --- | | protected | RunnableFutureTask() | Deprecated. |

Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | void | blockUntilFinished() | Deprecated.

Blocks until the task has finished, or has been canceled without having been started. | | void | blockUntilStarted() | Deprecated.

Blocks until the task has started, or has been canceled without having been started. | | boolean | cancel​(boolean interruptIfRunning) | Deprecated. | | protected void | cancelWork() | Deprecated.

Cancels any work being done by doWork(). | | protected abstract R | doWork() | Deprecated.

Performs the work or computation. | | R | get() | Deprecated. | | R | get​(long timeout, TimeUnit unit) | Deprecated. | | boolean | isCancelled() | Deprecated. | | boolean | isDone() | Deprecated. | | void | run() | Deprecated. |

- 

Methods inherited from class java.lang.Object

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

Constructor Detail

- 

RunnableFutureTask

protected RunnableFutureTask()

Deprecated.

Method Detail

- 

blockUntilStarted

public final void blockUntilStarted()

Deprecated.

Blocks until the task has started, or has been canceled without having been started.

- 

blockUntilFinished

public final void blockUntilFinished()

Deprecated.

Blocks until the task has finished, or has been canceled without having been started.

- 

get

public final[R](RunnableFutureTask.html "type parameter in RunnableFutureTask")get()
            throws[ExecutionException](https://developer.android.com/reference/java/util/concurrent/ExecutionException.html "class or interface in java.util.concurrent"),[InterruptedException](https://developer.android.com/reference/java/lang/InterruptedException.html "class or interface in java.lang")

Deprecated. Specified by:get in interface Future<R>Throws:ExecutionException``InterruptedException

- 

get

public final[R](RunnableFutureTask.html "type parameter in RunnableFutureTask")get​(long timeout,[TimeUnit](https://developer.android.com/reference/java/util/concurrent/TimeUnit.html "class or interface in java.util.concurrent")unit)
            throws[ExecutionException](https://developer.android.com/reference/java/util/concurrent/ExecutionException.html "class or interface in java.util.concurrent"),[InterruptedException](https://developer.android.com/reference/java/lang/InterruptedException.html "class or interface in java.lang"),[TimeoutException](https://developer.android.com/reference/java/util/concurrent/TimeoutException.html "class or interface in java.util.concurrent")

Deprecated. Specified by:get in interface Future<R>Throws:ExecutionException``InterruptedException``TimeoutException

- 

cancel

public final boolean cancel​(boolean interruptIfRunning)

Deprecated. Specified by:cancel in interface Future<R>

- 

isDone

public final boolean isDone()

Deprecated. Specified by:isDone in interface Future<R>

- 

isCancelled

public final boolean isCancelled()

Deprecated. Specified by:isCancelled in interface Future<R>

- 

run

public final void run()

Deprecated. Specified by:run in interface RunnableSpecified by:run in interface RunnableFuture<R>

- 

doWork

protected abstract[R](RunnableFutureTask.html "type parameter in RunnableFutureTask")doWork()
                     throws[E](RunnableFutureTask.html "type parameter in RunnableFutureTask")extends[Exception](https://developer.android.com/reference/java/lang/Exception.html "class or interface in java.lang")

Deprecated.

Performs the work or computation. Returns:The computed result.Throws:E - If an error occurred.E extends Exception

- 

cancelWork

protected void cancelWork()

Deprecated.

Cancels any work being done by doWork(). If doWork() is currently executing then the thread on which it's executing may be interrupted immediately after this method returns.

The default implementation does nothing.