1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2 <!--NewPage--> 3 <HTML> 4 <HEAD> 5 <!-- Generated by javadoc (build 1.6.0-google-internal) on Mon Jan 04 20:48:00 PST 2010 --> 6 <TITLE> 7 AbstractCheckedFuture (Guava Libraries 2010.01.04) 8 </TITLE> 9 10 <META NAME="date" CONTENT="2010-01-04"> 11 12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> 13 14 <SCRIPT type="text/javascript"> 15 function windowTitle() 16 { 17 if (location.href.indexOf('is-external=true') == -1) { 18 parent.document.title="AbstractCheckedFuture (Guava Libraries 2010.01.04)"; 19 } 20 } 21 </SCRIPT> 22 <NOSCRIPT> 23 </NOSCRIPT> 24 25 </HEAD> 26 27 <BODY BGCOLOR="white" onload="windowTitle();"> 28 <HR> 29 30 31 <!-- ========= START OF TOP NAVBAR ======= --> 32 <A NAME="navbar_top"><!-- --></A> 33 <A HREF="#skip-navbar_top" title="Skip navigation links"></A> 34 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 35 <TR> 36 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 37 <A NAME="navbar_top_firstrow"><!-- --></A> 38 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 39 <TR ALIGN="center" VALIGN="top"> 40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 42 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/AbstractCheckedFuture.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 46 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 47 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 48 </TR> 49 </TABLE> 50 </TD> 51 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 52 </EM> 53 </TD> 54 </TR> 55 56 <TR> 57 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 58 PREV CLASS 59 <A HREF="../../../../../com/google/common/util/concurrent/AbstractExecutionThreadService.html" title="class in com.google.common.util.concurrent"><B>NEXT CLASS</B></A></FONT></TD> 60 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 61 <A HREF="../../../../../index.html?com/google/common/util/concurrent/AbstractCheckedFuture.html" target="_top"><B>FRAMES</B></A> 62 <A HREF="AbstractCheckedFuture.html" target="_top"><B>NO FRAMES</B></A> 63 <SCRIPT type="text/javascript"> 64 <!-- 65 if(window==top) { 66 document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); 67 } 68 //--> 69 </SCRIPT> 70 <NOSCRIPT> 71 <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> 72 </NOSCRIPT> 73 74 75 </FONT></TD> 76 </TR> 77 <TR> 78 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 79 SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> 80 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 81 DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> 82 </TR> 83 </TABLE> 84 <A NAME="skip-navbar_top"></A> 85 <!-- ========= END OF TOP NAVBAR ========= --> 86 87 <HR> 88 <!-- ======== START OF CLASS DATA ======== --> 89 <H2> 90 <FONT SIZE="-1"> 91 com.google.common.util.concurrent</FONT> 92 <BR> 93 Class AbstractCheckedFuture<V,E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>></H2> 94 <PRE> 95 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> 96 <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.google.common.util.concurrent.AbstractCheckedFuture<V,E></B> 97 </PRE> 98 <DL> 99 <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A><V,E>, <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><V>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><V></DD> 100 </DL> 101 <HR> 102 <DL> 103 <DT><PRE>public abstract class <B>AbstractCheckedFuture<V,E extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>></B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A><DT>implements <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A><V,E></DL> 104 </PRE> 105 106 <P> 107 A delegating wrapper around a <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><CODE>ListenableFuture</CODE></A> that adds support for 108 the <A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html#checkedGet()"><CODE>checkedGet()</CODE></A> and <A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html#checkedGet(long, java.util.concurrent.TimeUnit)"><CODE>checkedGet(long, TimeUnit)</CODE></A> methods. 109 <P> 110 111 <P> 112 <DL> 113 <DT><B>Since:</B></DT> 114 <DD>2009.09.15 <b>tentative</b></DD> 115 <DT><B>Author:</B></DT> 116 <DD>Sven Mawson</DD> 117 </DL> 118 <HR> 119 120 <P> 121 <!-- =========== FIELD SUMMARY =========== --> 122 123 <A NAME="field_summary"><!-- --></A> 124 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 125 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 126 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 127 <B>Field Summary</B></FONT></TH> 128 </TR> 129 <TR BGCOLOR="white" CLASS="TableRowColor"> 130 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 131 <CODE>protected <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><<A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A>></CODE></FONT></TD> 132 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html#delegate">delegate</A></B></CODE> 133 134 <BR> 135 The delegate, used to pass along all our methods.</TD> 136 </TR> 137 </TABLE> 138 139 <!-- ======== CONSTRUCTOR SUMMARY ======== --> 140 141 <A NAME="constructor_summary"><!-- --></A> 142 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 143 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 144 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 145 <B>Constructor Summary</B></FONT></TH> 146 </TR> 147 <TR BGCOLOR="white" CLASS="TableRowColor"> 148 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 149 <CODE>protected </CODE></FONT></TD> 150 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html#AbstractCheckedFuture(com.google.common.util.concurrent.ListenableFuture)">AbstractCheckedFuture</A></B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><<A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A>> delegate)</CODE> 151 152 <BR> 153 Constructs an <code>AbstractCheckedFuture</code> that wraps a delegate.</TD> 154 </TR> 155 </TABLE> 156 157 <!-- ========== METHOD SUMMARY =========== --> 158 159 <A NAME="method_summary"><!-- --></A> 160 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 161 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 162 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 163 <B>Method Summary</B></FONT></TH> 164 </TR> 165 <TR BGCOLOR="white" CLASS="TableRowColor"> 166 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 167 <CODE> void</CODE></FONT></TD> 168 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html#addListener(java.lang.Runnable, java.util.concurrent.Executor)">addListener</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</A> listener, 169 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Executor.html?is-external=true" title="class or interface in java.util.concurrent">Executor</A> exec)</CODE> 170 171 <BR> 172 Adds a listener and executor to the ListenableFuture.</TD> 173 </TR> 174 <TR BGCOLOR="white" CLASS="TableRowColor"> 175 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 176 <CODE> boolean</CODE></FONT></TD> 177 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html#cancel(boolean)">cancel</A></B>(boolean mayInterruptIfRunning)</CODE> 178 179 <BR> 180 </TD> 181 </TR> 182 <TR BGCOLOR="white" CLASS="TableRowColor"> 183 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 184 <CODE> <A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A></CODE></FONT></TD> 185 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html#checkedGet()">checkedGet</A></B>()</CODE> 186 187 <BR> 188 Exception checking version of <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get()" title="class or interface in java.util.concurrent"><CODE>Future.get()</CODE></A> that will translate 189 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang"><CODE>InterruptedException</CODE></A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/CancellationException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>CancellationException</CODE></A> and 190 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ExecutionException</CODE></A> into application-specific exceptions.</TD> 191 </TR> 192 <TR BGCOLOR="white" CLASS="TableRowColor"> 193 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 194 <CODE> <A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A></CODE></FONT></TD> 195 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html#checkedGet(long, java.util.concurrent.TimeUnit)">checkedGet</A></B>(long timeout, 196 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</A> unit)</CODE> 197 198 <BR> 199 Exception checking version of <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get(long, java.util.concurrent.TimeUnit)" title="class or interface in java.util.concurrent"><CODE>Future.get(long, TimeUnit)</CODE></A> that will 200 translate <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang"><CODE>InterruptedException</CODE></A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/CancellationException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>CancellationException</CODE></A> and 201 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ExecutionException</CODE></A> into application-specific exceptions.</TD> 202 </TR> 203 <TR BGCOLOR="white" CLASS="TableRowColor"> 204 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 205 <CODE> <A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A></CODE></FONT></TD> 206 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html#get()">get</A></B>()</CODE> 207 208 <BR> 209 </TD> 210 </TR> 211 <TR BGCOLOR="white" CLASS="TableRowColor"> 212 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 213 <CODE> <A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A></CODE></FONT></TD> 214 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html#get(long, java.util.concurrent.TimeUnit)">get</A></B>(long timeout, 215 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</A> unit)</CODE> 216 217 <BR> 218 </TD> 219 </TR> 220 <TR BGCOLOR="white" CLASS="TableRowColor"> 221 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 222 <CODE> boolean</CODE></FONT></TD> 223 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html#isCancelled()">isCancelled</A></B>()</CODE> 224 225 <BR> 226 </TD> 227 </TR> 228 <TR BGCOLOR="white" CLASS="TableRowColor"> 229 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 230 <CODE> boolean</CODE></FONT></TD> 231 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html#isDone()">isDone</A></B>()</CODE> 232 233 <BR> 234 </TD> 235 </TR> 236 <TR BGCOLOR="white" CLASS="TableRowColor"> 237 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 238 <CODE>protected abstract <A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">E</A></CODE></FONT></TD> 239 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html#mapException(java.lang.Exception)">mapException</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A> e)</CODE> 240 241 <BR> 242 Translate from an <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang"><CODE>InterruptedException</CODE></A>, 243 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/CancellationException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>CancellationException</CODE></A> or <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ExecutionException</CODE></A> to an exception 244 of type <code>E</code>.</TD> 245 </TR> 246 </TABLE> 247 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> 248 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 249 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 250 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> 251 </TR> 252 <TR BGCOLOR="white" CLASS="TableRowColor"> 253 <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> 254 </TR> 255 </TABLE> 256 257 <P> 258 259 <!-- ============ FIELD DETAIL =========== --> 260 261 <A NAME="field_detail"><!-- --></A> 262 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 263 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 264 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 265 <B>Field Detail</B></FONT></TH> 266 </TR> 267 </TABLE> 268 269 <A NAME="delegate"><!-- --></A><H3> 270 delegate</H3> 271 <PRE> 272 protected final <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><<A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A>> <B>delegate</B></PRE> 273 <DL> 274 <DD>The delegate, used to pass along all our methods. 275 <P> 276 <DL> 277 </DL> 278 </DL> 279 280 <!-- ========= CONSTRUCTOR DETAIL ======== --> 281 282 <A NAME="constructor_detail"><!-- --></A> 283 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 284 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 285 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 286 <B>Constructor Detail</B></FONT></TH> 287 </TR> 288 </TABLE> 289 290 <A NAME="AbstractCheckedFuture(com.google.common.util.concurrent.ListenableFuture)"><!-- --></A><H3> 291 AbstractCheckedFuture</H3> 292 <PRE> 293 protected <B>AbstractCheckedFuture</B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><<A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A>> delegate)</PRE> 294 <DL> 295 <DD>Constructs an <code>AbstractCheckedFuture</code> that wraps a delegate. 296 <P> 297 </DL> 298 299 <!-- ============ METHOD DETAIL ========== --> 300 301 <A NAME="method_detail"><!-- --></A> 302 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 303 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 304 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 305 <B>Method Detail</B></FONT></TH> 306 </TR> 307 </TABLE> 308 309 <A NAME="mapException(java.lang.Exception)"><!-- --></A><H3> 310 mapException</H3> 311 <PRE> 312 protected abstract <A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">E</A> <B>mapException</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A> e)</PRE> 313 <DL> 314 <DD>Translate from an <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang"><CODE>InterruptedException</CODE></A>, 315 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/CancellationException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>CancellationException</CODE></A> or <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ExecutionException</CODE></A> to an exception 316 of type <code>E</code>. Subclasses must implement the mapping themselves. 317 318 The <code>e</code> parameter can be an instance of <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang"><CODE>InterruptedException</CODE></A>, 319 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/CancellationException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>CancellationException</CODE></A>, or <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ExecutionException</CODE></A>. 320 <P> 321 <DD><DL> 322 </DL> 323 </DD> 324 <DD><DL> 325 </DL> 326 </DD> 327 </DL> 328 <HR> 329 330 <A NAME="checkedGet()"><!-- --></A><H3> 331 checkedGet</H3> 332 <PRE> 333 public <A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A> <B>checkedGet</B>() 334 throws <A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">E</A> extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A></PRE> 335 <DL> 336 <DD><B>Description copied from interface: <CODE><A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html#checkedGet()">CheckedFuture</A></CODE></B></DD> 337 <DD>Exception checking version of <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get()" title="class or interface in java.util.concurrent"><CODE>Future.get()</CODE></A> that will translate 338 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang"><CODE>InterruptedException</CODE></A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/CancellationException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>CancellationException</CODE></A> and 339 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ExecutionException</CODE></A> into application-specific exceptions. 340 <P> 341 <DD><DL> 342 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html#checkedGet()">checkedGet</A></CODE> in interface <CODE><A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A><<A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A>,<A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">E</A> extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>></CODE></DL> 343 </DD> 344 <DD><DL> 345 346 <DT><B>Returns:</B><DD>the result of executing the future. 347 <DT><B>Throws:</B> 348 <DD><CODE>E</CODE> - on interruption, cancellation or execution exceptions. 349 <DD><CODE><A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">E</A> extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A></CODE></DL> 350 </DD> 351 </DL> 352 <HR> 353 354 <A NAME="checkedGet(long, java.util.concurrent.TimeUnit)"><!-- --></A><H3> 355 checkedGet</H3> 356 <PRE> 357 public <A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A> <B>checkedGet</B>(long timeout, 358 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</A> unit) 359 throws <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/TimeoutException.html?is-external=true" title="class or interface in java.util.concurrent">TimeoutException</A>, 360 <A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">E</A> extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A></PRE> 361 <DL> 362 <DD><B>Description copied from interface: <CODE><A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html#checkedGet(long, java.util.concurrent.TimeUnit)">CheckedFuture</A></CODE></B></DD> 363 <DD>Exception checking version of <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get(long, java.util.concurrent.TimeUnit)" title="class or interface in java.util.concurrent"><CODE>Future.get(long, TimeUnit)</CODE></A> that will 364 translate <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang"><CODE>InterruptedException</CODE></A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/CancellationException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>CancellationException</CODE></A> and 365 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ExecutionException</CODE></A> into application-specific exceptions. On 366 timeout this method throws a normal <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/TimeoutException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>TimeoutException</CODE></A>. 367 <P> 368 <DD><DL> 369 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html#checkedGet(long, java.util.concurrent.TimeUnit)">checkedGet</A></CODE> in interface <CODE><A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A><<A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A>,<A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">E</A> extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>></CODE></DL> 370 </DD> 371 <DD><DL> 372 373 <DT><B>Returns:</B><DD>the result of executing the future. 374 <DT><B>Throws:</B> 375 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/TimeoutException.html?is-external=true" title="class or interface in java.util.concurrent">TimeoutException</A></CODE> - if retrieving the result timed out. 376 <DD><CODE>E</CODE> - on interruption, cancellation or execution exceptions. 377 <DD><CODE><A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">E</A> extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A></CODE></DL> 378 </DD> 379 </DL> 380 <HR> 381 382 <A NAME="cancel(boolean)"><!-- --></A><H3> 383 cancel</H3> 384 <PRE> 385 public boolean <B>cancel</B>(boolean mayInterruptIfRunning)</PRE> 386 <DL> 387 <DD><DL> 388 <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#cancel(boolean)" title="class or interface in java.util.concurrent">cancel</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><<A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A>></CODE></DL> 389 </DD> 390 <DD><DL> 391 </DL> 392 </DD> 393 </DL> 394 <HR> 395 396 <A NAME="isCancelled()"><!-- --></A><H3> 397 isCancelled</H3> 398 <PRE> 399 public boolean <B>isCancelled</B>()</PRE> 400 <DL> 401 <DD><DL> 402 <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#isCancelled()" title="class or interface in java.util.concurrent">isCancelled</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><<A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A>></CODE></DL> 403 </DD> 404 <DD><DL> 405 </DL> 406 </DD> 407 </DL> 408 <HR> 409 410 <A NAME="isDone()"><!-- --></A><H3> 411 isDone</H3> 412 <PRE> 413 public boolean <B>isDone</B>()</PRE> 414 <DL> 415 <DD><DL> 416 <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#isDone()" title="class or interface in java.util.concurrent">isDone</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><<A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A>></CODE></DL> 417 </DD> 418 <DD><DL> 419 </DL> 420 </DD> 421 </DL> 422 <HR> 423 424 <A NAME="get()"><!-- --></A><H3> 425 get</H3> 426 <PRE> 427 public <A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A> <B>get</B>() 428 throws <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A>, 429 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent">ExecutionException</A></PRE> 430 <DL> 431 <DD><DL> 432 <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get()" title="class or interface in java.util.concurrent">get</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><<A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A>></CODE></DL> 433 </DD> 434 <DD><DL> 435 436 <DT><B>Throws:</B> 437 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE> 438 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent">ExecutionException</A></CODE></DL> 439 </DD> 440 </DL> 441 <HR> 442 443 <A NAME="get(long, java.util.concurrent.TimeUnit)"><!-- --></A><H3> 444 get</H3> 445 <PRE> 446 public <A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A> <B>get</B>(long timeout, 447 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</A> unit) 448 throws <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A>, 449 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent">ExecutionException</A>, 450 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/TimeoutException.html?is-external=true" title="class or interface in java.util.concurrent">TimeoutException</A></PRE> 451 <DL> 452 <DD><DL> 453 <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get(long, java.util.concurrent.TimeUnit)" title="class or interface in java.util.concurrent">get</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><<A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A>></CODE></DL> 454 </DD> 455 <DD><DL> 456 457 <DT><B>Throws:</B> 458 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</A></CODE> 459 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent">ExecutionException</A></CODE> 460 <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/TimeoutException.html?is-external=true" title="class or interface in java.util.concurrent">TimeoutException</A></CODE></DL> 461 </DD> 462 </DL> 463 <HR> 464 465 <A NAME="addListener(java.lang.Runnable, java.util.concurrent.Executor)"><!-- --></A><H3> 466 addListener</H3> 467 <PRE> 468 public void <B>addListener</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</A> listener, 469 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Executor.html?is-external=true" title="class or interface in java.util.concurrent">Executor</A> exec)</PRE> 470 <DL> 471 <DD><B>Description copied from interface: <CODE><A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html#addListener(java.lang.Runnable, java.util.concurrent.Executor)">ListenableFuture</A></CODE></B></DD> 472 <DD><p>Adds a listener and executor to the ListenableFuture. 473 The listener will be <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Executor.html?is-external=true#execute(java.lang.Runnable)" title="class or interface in java.util.concurrent">passed 474 to the executor</A> for execution when the <code>Future</code>'s computation is 475 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#isDone()" title="class or interface in java.util.concurrent">complete</A>. 476 477 <p>There is no guaranteed ordering of execution of listeners, they may get 478 called in the order they were added and they may get called out of order, 479 but any listener added through this method is guaranteed to be called once 480 the computation is complete. 481 <P> 482 <DD><DL> 483 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html#addListener(java.lang.Runnable, java.util.concurrent.Executor)">addListener</A></CODE> in interface <CODE><A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A><<A HREF="../../../../../com/google/common/util/concurrent/AbstractCheckedFuture.html" title="type parameter in AbstractCheckedFuture">V</A>></CODE></DL> 484 </DD> 485 <DD><DL> 486 <DT><B>Parameters:</B><DD><CODE>listener</CODE> - the listener to run when the computation is complete.<DD><CODE>exec</CODE> - the executor to run the listener in.</DL> 487 </DD> 488 </DL> 489 <!-- ========= END OF CLASS DATA ========= --> 490 <HR> 491 492 493 <!-- ======= START OF BOTTOM NAVBAR ====== --> 494 <A NAME="navbar_bottom"><!-- --></A> 495 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> 496 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 497 <TR> 498 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 499 <A NAME="navbar_bottom_firstrow"><!-- --></A> 500 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 501 <TR ALIGN="center" VALIGN="top"> 502 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 503 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 504 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 505 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/AbstractCheckedFuture.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 506 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 507 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 508 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 509 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 510 </TR> 511 </TABLE> 512 </TD> 513 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 514 </EM> 515 </TD> 516 </TR> 517 518 <TR> 519 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 520 PREV CLASS 521 <A HREF="../../../../../com/google/common/util/concurrent/AbstractExecutionThreadService.html" title="class in com.google.common.util.concurrent"><B>NEXT CLASS</B></A></FONT></TD> 522 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 523 <A HREF="../../../../../index.html?com/google/common/util/concurrent/AbstractCheckedFuture.html" target="_top"><B>FRAMES</B></A> 524 <A HREF="AbstractCheckedFuture.html" target="_top"><B>NO FRAMES</B></A> 525 <SCRIPT type="text/javascript"> 526 <!-- 527 if(window==top) { 528 document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); 529 } 530 //--> 531 </SCRIPT> 532 <NOSCRIPT> 533 <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> 534 </NOSCRIPT> 535 536 537 </FONT></TD> 538 </TR> 539 <TR> 540 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 541 SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> 542 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 543 DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> 544 </TR> 545 </TABLE> 546 <A NAME="skip-navbar_bottom"></A> 547 <!-- ======== END OF BOTTOM NAVBAR ======= --> 548 549 <HR> 550 551 </BODY> 552 </HTML> 553