org.jboss.forge.container.util
Class CompletedFuture<T>
java.lang.Object
org.jboss.forge.container.util.CompletedFuture<T>
- All Implemented Interfaces:
- Future<T>
public class CompletedFuture<T>
- extends Object
- implements Future<T>
A pass-through Future that simply returns the specified value immediately.
- Author:
- Lincoln Baxter, III
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CompletedFuture
public CompletedFuture(T value)
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancel in interface Future<T>
get
public T get()
throws InterruptedException,
ExecutionException
- Specified by:
get in interface Future<T>
- Throws:
InterruptedException
ExecutionException
get
public T get(long timeout,
TimeUnit unit)
throws InterruptedException,
ExecutionException,
TimeoutException
- Specified by:
get in interface Future<T>
- Throws:
InterruptedException
ExecutionException
TimeoutException
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled in interface Future<T>
isDone
public boolean isDone()
- Specified by:
isDone in interface Future<T>
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.