edu.rice.cs.util.swing
Class AsyncCompletionArgs<R>

java.lang.Object
  extended by edu.rice.cs.util.swing.AsyncCompletionArgs<R>

public class AsyncCompletionArgs<R>
extends Object

Author:
jlugo

Constructor Summary
AsyncCompletionArgs(R result, boolean cancelRequested)
           
AsyncCompletionArgs(R result, Exception caughtException, boolean wasCanceled)
           
 
Method Summary
 boolean cancelRequested()
          Returns whether the user requested cancellation of the operation before completion.
 Exception getCaughtException()
          Returns the exception thrown from within the asynchronous task if an exception was thrown.
 R getResult()
          Returns the result of the asynchronous computation performed by the AsyncTask.
 void throwCaughtException()
          If an exception was thrown during the execution of the AsyncTask, calling this method will cause the exception to be thrown again in the thread that calls this method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncCompletionArgs

public AsyncCompletionArgs(R result,
                           boolean cancelRequested)

AsyncCompletionArgs

public AsyncCompletionArgs(R result,
                           Exception caughtException,
                           boolean wasCanceled)
Method Detail

getResult

public R getResult()
Returns the result of the asynchronous computation performed by the AsyncTask. If the task threw an exception, this value will be null. The exception can be obtained by calling getCaughtException

Returns:
The resulting data produced by AsyncTask.runAsync

getCaughtException

public Exception getCaughtException()
Returns the exception thrown from within the asynchronous task if an exception was thrown. If no exception was thrown and the task completed successfully, this value will be null.

Returns:
The exception that was caught when running AsyncTask.runAsync or null if no exception was thrown.

throwCaughtException

public void throwCaughtException()
                          throws Exception
If an exception was thrown during the execution of the AsyncTask, calling this method will cause the exception to be thrown again in the thread that calls this method. If no exception was thrown, this method does nothing.

Throws:
Exception - if an exception was thrown from within the asynchronous task.

cancelRequested

public boolean cancelRequested()
Returns whether the user requested cancellation of the operation before completion. The task itself is responsible for terminating its own execution and thus may have successfully completed.

Returns:
Whether the user requested for the task to be canceled was