public class FutureImpl<V> extends AbstractQueuedSynchronizer implements Future<V>
AbstractQueuedSynchronizer.ConditionObject
Constructor and Description |
---|
FutureImpl(long id) |
FutureImpl(long id,
Exception error) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
V |
get() |
V |
get(long timeout,
TimeUnit unit) |
Long |
getId() |
boolean |
isCancelled() |
boolean |
isDone() |
void |
setError(Exception e) |
void |
setValue(V v) |
acquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedPredecessors, hasQueuedThreads, hasWaiters, isQueued, owns, release, releaseShared, toString, tryAcquireNanos, tryAcquireSharedNanos
public FutureImpl(long id)
public FutureImpl(long id, Exception error)
public void setValue(V v)
public void setError(Exception e)
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<V>
public V get() throws InterruptedException, ExecutionException
get
in interface Future<V>
InterruptedException
ExecutionException
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<V>
InterruptedException
ExecutionException
TimeoutException
public Long getId()
Copyright © 2017. All rights reserved.