|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectProgressTask
public class ProgressTask
An implementation of the Progress interface.
Field Summary |
---|
Fields inherited from interface Progress |
---|
WORKING |
Constructor Summary | |
---|---|
ProgressTask(Process process,
Map<String,Object> input)
Creates a ProgressTask that will execute the given Process when run. |
Method Summary | |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
|
protected void |
done()
This protected method is invoked when this process transitions to state isDone (whether normally or via cancellation). |
Map<String,Object> |
get()
|
Map<String,Object> |
get(long timeout,
TimeUnit unit)
|
float |
getProgress()
Amount of work completed. |
boolean |
isCancelled()
|
boolean |
isDone()
|
void |
run()
Sets this ProgressTask to the result of the computation unless it has been canceled. |
protected boolean |
runAndReset()
Executes the process without setting its result, and then resets this ProgressTask to its initial state, failing to do so if the computation encounters an exception or is canceled. |
protected void |
set(Map<String,Object> value)
Sets the result of this ProgressTask to the given value unless this ProgressTask has already been set or has been canceled. |
protected void |
setException(Throwable t)
Causes this ProgressTask to report an ExecutionException with the given throwable as its cause, unless this ProgressTask has already been set or has been canceled. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProgressTask(Process process, Map<String,Object> input)
process
- the process to executeinput
- the inputs to use when executing the process
NullPointerException
- if process is nullMethod Detail |
---|
public float getProgress()
Progress
getProgress
in interface Progress
public boolean isCancelled()
isCancelled
in interface Future<Map<String,Object>>
public boolean isDone()
isDone
in interface Future<Map<String,Object>>
public boolean cancel(boolean mayInterruptIfRunning)
cancel
in interface Future<Map<String,Object>>
public Map<String,Object> get() throws InterruptedException, ExecutionException
get
in interface Future<Map<String,Object>>
InterruptedException
ExecutionException
public Map<String,Object> get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<Map<String,Object>>
InterruptedException
ExecutionException
TimeoutException
protected void done()
protected void set(Map<String,Object> value)
value
- the value to setprotected void setException(Throwable t)
t
- the cause of failure.public void run()
run
in interface Runnable
protected boolean runAndReset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |