cz.cuni.amis.utils.future
Class FutureWrapper<RESULT>
java.lang.Object
cz.cuni.amis.utils.future.FutureWrapper<RESULT>
- All Implemented Interfaces:
- IFuture<RESULT>, Future<RESULT>
public class FutureWrapper<RESULT>
- extends Object
- implements IFuture<RESULT>
Method Summary |
boolean |
cancel(boolean mayInterruptIfRunning)
|
RESULT |
get()
Waits if necessary for the computation to complete, and then
retrieves its result. |
RESULT |
get(long timeout,
TimeUnit unit)
Waits if necessary for at most the given time for the computation
to complete, and then retrieves its result, if available. |
boolean |
isCancelled()
|
boolean |
isDone()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FutureWrapper
public FutureWrapper(IFuture<RESULT> impl)
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancel
in interface Future<RESULT>
get
public RESULT get()
- Description copied from interface:
IFuture
- Waits if necessary for the computation to complete, and then
retrieves its result.
- Specified by:
get
in interface IFuture<RESULT>
- Specified by:
get
in interface Future<RESULT>
- Returns:
- the computed result
get
public RESULT get(long timeout,
TimeUnit unit)
- Description copied from interface:
IFuture
- Waits if necessary for at most the given time for the computation
to complete, and then retrieves its result, if available.
- Specified by:
get
in interface IFuture<RESULT>
- Specified by:
get
in interface Future<RESULT>
- Parameters:
timeout
- the maximum time to waitunit
- the time unit of the timeout argument
- Returns:
- the computed result
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interface Future<RESULT>
isDone
public boolean isDone()
- Specified by:
isDone
in interface Future<RESULT>
Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.