# RunnableFuture

public interface **RunnableFuture** implements [Runnable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Runnable.html) [Future](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/Future.html)\<V\>

|---|---|---|
| Known Indirect Subclasses [FutureTask](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/FutureTask.html)\<V\>, [RunnableScheduledFuture](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/RunnableScheduledFuture.html)\<V\> |---|---| | [FutureTask](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/FutureTask.html)\<V\> | A cancellable asynchronous computation. | | [RunnableScheduledFuture](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/RunnableScheduledFuture.html)\<V\> | A `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/ScheduledFuture.html` that is `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Runnable.html`. | |||

A `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/Future.html` that is `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Runnable.html`. Successful execution of
the `run` method causes completion of the `Future`
and allows access to its results.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/FutureTask.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/Executor.html`

### Public Method Summary

|---|---|
| abstract void | [run](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/RunnableFuture.html#run())() Sets this Future to the result of its computation unless it has been cancelled. |

### Inherited Method Summary

From interface [java.lang.Runnable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Runnable.html)

|---|---|
| abstract void | [run](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Runnable.html#run())() When an object implementing interface `Runnable` is used to create a thread, starting the thread causes the object's `run` method to be called in that separately executing thread. |

From interface [java.util.concurrent.Future](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/Future.html)

|---|---|
| abstract boolean | [cancel](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/Future.html#cancel(boolean))(boolean mayInterruptIfRunning) Attempts to cancel execution of this task. |
| abstract V | [get](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/Future.html#get(long,%20java.util.concurrent.TimeUnit))(long timeout, [TimeUnit](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/TimeUnit.html) unit) Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available. |
| abstract V | [get](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/Future.html#get())() Waits if necessary for the computation to complete, and then retrieves its result. |
| abstract boolean | [isCancelled](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/Future.html#isCancelled())() Returns `true` if this task was cancelled before it completed normally. |
| abstract boolean | [isDone](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/Future.html#isDone())() Returns `true` if this task completed. |

## Public Methods

#### public abstract void
**run**
()

Sets this Future to the result of its computation
unless it has been cancelled.