public abstract class BackgroundTask<V>
extends java.lang.Object
implements java.lang.Runnable, java.util.concurrent.Future<V>
| Constructor and Description | 
|---|
BackgroundTask()  | 
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
cancel(boolean mayInterruptIfRunning)  | 
protected abstract V | 
compute()  | 
V | 
get()  | 
V | 
get(long timeout,
   java.util.concurrent.TimeUnit unit)  | 
boolean | 
isCancelled()  | 
boolean | 
isDone()  | 
protected void | 
onCompletion(V result,
            java.lang.Throwable exception,
            boolean cancelled)  | 
protected void | 
onProgress(int current,
          int max)  | 
void | 
run()  | 
protected void | 
setProgress(int current,
           int max)  | 
protected void setProgress(int current,
               int max)
protected abstract V compute() throws java.lang.Exception
java.lang.Exceptionprotected void onCompletion(V result, java.lang.Throwable exception, boolean cancelled)
protected void onProgress(int current,
              int max)
public boolean cancel(boolean mayInterruptIfRunning)
cancel in interface java.util.concurrent.Future<V>public V get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get in interface java.util.concurrent.Future<V>java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionpublic V get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
get in interface java.util.concurrent.Future<V>java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionjava.util.concurrent.TimeoutExceptionpublic boolean isCancelled()
isCancelled in interface java.util.concurrent.Future<V>public boolean isDone()
isDone in interface java.util.concurrent.Future<V>public void run()
run in interface java.lang.Runnable