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 Callables (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="Callables (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/Callables.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 <A HREF="../../../../../com/google/common/util/concurrent/AbstractService.html" title="class in com.google.common.util.concurrent"><B>PREV CLASS</B></A> 59 <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface 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/Callables.html" target="_top"><B>FRAMES</B></A> 62 <A HREF="Callables.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 | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> 80 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 81 DETAIL: FIELD | CONSTR | <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 Callables</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.Callables</B> 97 </PRE> 98 <HR> 99 <DL> 100 <DT><PRE>public final class <B>Callables</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></DL> 101 </PRE> 102 103 <P> 104 Static utility methods pertaining to the <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>Callable</CODE></A> interface. 105 <P> 106 107 <P> 108 <DL> 109 <DT><B>Since:</B></DT> 110 <DD>2009.09.15 <b>tentative</b></DD> 111 <DT><B>Author:</B></DT> 112 <DD>Isaac Shum</DD> 113 </DL> 114 <HR> 115 116 <P> 117 118 <!-- ========== METHOD SUMMARY =========== --> 119 120 <A NAME="method_summary"><!-- --></A> 121 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 122 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 123 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 124 <B>Method Summary</B></FONT></TH> 125 </TR> 126 <TR BGCOLOR="white" CLASS="TableRowColor"> 127 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 128 <CODE>static 129 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 130 <TR ALIGN="right" VALIGN=""> 131 <TD NOWRAP><FONT SIZE="-1"> 132 <CODE><T> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</A><T></CODE></FONT></TD> 133 </TR> 134 </TABLE> 135 </CODE></FONT></TD> 136 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Callables.html#returning(T)">returning</A></B>(T value)</CODE> 137 138 <BR> 139 Creates a <code>Callable</code> which immediately returns a preset value each 140 time it is called.</TD> 141 </TR> 142 </TABLE> 143 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> 144 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 145 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 146 <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> 147 </TR> 148 <TR BGCOLOR="white" CLASS="TableRowColor"> 149 <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> 150 </TR> 151 </TABLE> 152 153 <P> 154 155 <!-- ============ METHOD DETAIL ========== --> 156 157 <A NAME="method_detail"><!-- --></A> 158 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 159 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 160 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 161 <B>Method Detail</B></FONT></TH> 162 </TR> 163 </TABLE> 164 165 <A NAME="returning(java.lang.Object)"><!-- --></A><A NAME="returning(T)"><!-- --></A><H3> 166 returning</H3> 167 <PRE> 168 public static <T> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</A><T> <B>returning</B>(<FONT SIZE="-1"><A HREF="http://jsr-305.googlecode.com/svn/trunk/javadoc/javax/annotation/Nullable.html?is-external=true" title="class or interface in javax.annotation">@Nullable</A></FONT> 169 T value)</PRE> 170 <DL> 171 <DD>Creates a <code>Callable</code> which immediately returns a preset value each 172 time it is called. 173 <P> 174 <DD><DL> 175 </DL> 176 </DD> 177 </DL> 178 <!-- ========= END OF CLASS DATA ========= --> 179 <HR> 180 181 182 <!-- ======= START OF BOTTOM NAVBAR ====== --> 183 <A NAME="navbar_bottom"><!-- --></A> 184 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> 185 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 186 <TR> 187 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 188 <A NAME="navbar_bottom_firstrow"><!-- --></A> 189 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 190 <TR ALIGN="center" VALIGN="top"> 191 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 192 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 193 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 194 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Callables.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 195 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 196 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 197 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 198 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 199 </TR> 200 </TABLE> 201 </TD> 202 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 203 </EM> 204 </TD> 205 </TR> 206 207 <TR> 208 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 209 <A HREF="../../../../../com/google/common/util/concurrent/AbstractService.html" title="class in com.google.common.util.concurrent"><B>PREV CLASS</B></A> 210 <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent"><B>NEXT CLASS</B></A></FONT></TD> 211 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 212 <A HREF="../../../../../index.html?com/google/common/util/concurrent/Callables.html" target="_top"><B>FRAMES</B></A> 213 <A HREF="Callables.html" target="_top"><B>NO FRAMES</B></A> 214 <SCRIPT type="text/javascript"> 215 <!-- 216 if(window==top) { 217 document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); 218 } 219 //--> 220 </SCRIPT> 221 <NOSCRIPT> 222 <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> 223 </NOSCRIPT> 224 225 226 </FONT></TD> 227 </TR> 228 <TR> 229 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 230 SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> 231 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 232 DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> 233 </TR> 234 </TABLE> 235 <A NAME="skip-navbar_bottom"></A> 236 <!-- ======== END OF BOTTOM NAVBAR ======= --> 237 238 <HR> 239 240 </BODY> 241 </HTML> 242