1 33 34 package edu.rice.cs.util.swing; 35 36 40 public class AsyncCompletionArgs<R> { 41 42 private R _result; 43 44 private Exception _caughtException; 45 46 private boolean _cancelRequested; 47 48 public AsyncCompletionArgs(R result, boolean cancelRequested) { 49 this(result, null, cancelRequested); 50 } 51 52 public AsyncCompletionArgs(R result, Exception caughtException, boolean wasCanceled) { 53 _result = result; 54 _caughtException = caughtException; 55 _cancelRequested = wasCanceled; 56 } 57 58 66 public R getResult() { 67 return _result; 68 } 69 70 79 public Exception getCaughtException() { 80 return _caughtException; 81 } 82 83 91 public void throwCaughtException() throws Exception { 92 if (_caughtException != null) { 93 throw _caughtException; 94 } 95 } 96 97 104 public boolean cancelRequested() { 105 return _cancelRequested; 106 } 107 } 108 | Popular Tags |