Constructor and Description |
---|
RunnableFuture() |
Modifier and Type | Method and Description |
---|---|
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() |
protected abstract RESULT |
process()
Provide the implementation of your work that returns some RESULT or throws an exception if something happens.
|
void |
run() |
protected abstract RESULT process() throws Exception
Exception
public final boolean cancel(boolean mayInterruptIfRunning)
public final RESULT get()
IFuture
public final RESULT get(long timeout, TimeUnit unit) throws PogamutInterruptedException, PogamutTimeoutException
IFuture
get
in interface IFuture<RESULT>
get
in interface Future<RESULT>
timeout
- the maximum time to waitunit
- the time unit of the timeout argumentPogamutInterruptedException
- if the current thread was interrupted while waitingPogamutTimeoutException
- if the wait timed outpublic final boolean isCancelled()
isCancelled
in interface Future<RESULT>
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.