Constructor and Description |
---|
ProgressTask(Process process,
Map<String,Object> input)
Creates a ProgressTask that will execute the given Process when run.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public ProgressTask(Process process, Map<String,Object> input)
process
- the process to executeinput
- the inputs to use when executing the processNullPointerException
- if process is nullpublic float getProgress()
Progress
getProgress
in interface Progress
public boolean isCancelled()
isCancelled
in interface Future<Map<String,Object>>
public boolean cancel(boolean mayInterruptIfRunning)
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()
protected boolean runAndReset()
Copyright © 1996–2019 Geotools. All rights reserved.