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:47:57 PST 2010 --> 6<TITLE> 7ClassToInstanceMap (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"> 15function windowTitle() 16{ 17 if (location.href.indexOf('is-external=true') == -1) { 18 parent.document.title="ClassToInstanceMap (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/ClassToInstanceMap.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/collect/BiMap.html" title="interface in com.google.common.collect"><B>PREV CLASS</B></A> 59 <A HREF="../../../../com/google/common/collect/Collections2.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD> 60<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 61 <A HREF="../../../../index.html?com/google/common/collect/ClassToInstanceMap.html" target="_top"><B>FRAMES</B></A> 62 <A HREF="ClassToInstanceMap.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"> 81DETAIL: 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"> 91com.google.common.collect</FONT> 92<BR> 93Interface ClassToInstanceMap<B></H2> 94<DL> 95<DT><DT><B>Type Parameters:</B><DD><CODE>B</CODE> - the common supertype that all entries must share; often this is 96 simply <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><CODE>Object</CODE></A></DL> 97<DL> 98<DT><B>All Superinterfaces:</B> <DD><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><? extends B>,B></DD> 99</DL> 100<DL> 101<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../com/google/common/collect/ImmutableClassToInstanceMap.html" title="class in com.google.common.collect">ImmutableClassToInstanceMap</A>, <A HREF="../../../../com/google/common/collect/MutableClassToInstanceMap.html" title="class in com.google.common.collect">MutableClassToInstanceMap</A></DD> 102</DL> 103<HR> 104<DL> 105<DT><PRE>public interface <B>ClassToInstanceMap<B></B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><? extends B>,B></DL> 106</PRE> 107 108<P> 109A map, each entry of which maps a Java 110 <a href="http://tinyurl.com/2cmwkz">raw type</a> to an instance of that type. 111 In addition to implementing <code>Map</code>, the additional type-safe operations 112 <A HREF="../../../../com/google/common/collect/ClassToInstanceMap.html#putInstance(java.lang.Class, T)"><CODE>putInstance(java.lang.Class<T>, T)</CODE></A> and <A HREF="../../../../com/google/common/collect/ClassToInstanceMap.html#getInstance(java.lang.Class)"><CODE>getInstance(java.lang.Class<T>)</CODE></A> are available. 113 114 <p>Like any other <code>Map<Class, Object></code>, this map may contain entries 115 for primitive types, and a primitive type and its corresponding wrapper type 116 may map to different values. 117<P> 118 119<P> 120<DL> 121<DT><B>Since:</B></DT> 122 <DD>2010.01.04 <b>stable</b> (imported from Google Collections Library)</DD> 123<DT><B>Author:</B></DT> 124 <DD>Kevin Bourrillion</DD> 125</DL> 126<HR> 127 128<P> 129<!-- ======== NESTED CLASS SUMMARY ======== --> 130 131<A NAME="nested_class_summary"><!-- --></A> 132<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 133<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 134<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 135<B>Nested Class Summary</B></FONT></TH> 136</TR> 137</TABLE> 138 <A NAME="nested_classes_inherited_from_class_java.util.Map"><!-- --></A> 139<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 140<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 141<TH ALIGN="left"><B>Nested classes/interfaces inherited from interface java.util.<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A></B></TH> 142</TR> 143<TR BGCOLOR="white" CLASS="TableRowColor"> 144<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">Map.Entry</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">K</A>,<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">V</A>></CODE></TD> 145</TR> 146</TABLE> 147 148 149<!-- ========== METHOD SUMMARY =========== --> 150 151<A NAME="method_summary"><!-- --></A> 152<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 153<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 154<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 155<B>Method Summary</B></FONT></TH> 156</TR> 157<TR BGCOLOR="white" CLASS="TableRowColor"> 158<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 159<CODE> 160<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 161<TR ALIGN="right" VALIGN=""> 162<TD NOWRAP><FONT SIZE="-1"> 163<CODE><T extends <A HREF="../../../../com/google/common/collect/ClassToInstanceMap.html" title="type parameter in ClassToInstanceMap">B</A>> 164<BR> 165T</CODE></FONT></TD> 166</TR> 167</TABLE> 168</CODE></FONT></TD> 169<TD><CODE><B><A HREF="../../../../com/google/common/collect/ClassToInstanceMap.html#getInstance(java.lang.Class)">getInstance</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><T> type)</CODE> 170 171<BR> 172 Returns the value the specified class is mapped to, or <code>null</code> if no 173 entry for this class is present.</TD> 174</TR> 175<TR BGCOLOR="white" CLASS="TableRowColor"> 176<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 177<CODE> 178<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 179<TR ALIGN="right" VALIGN=""> 180<TD NOWRAP><FONT SIZE="-1"> 181<CODE><T extends <A HREF="../../../../com/google/common/collect/ClassToInstanceMap.html" title="type parameter in ClassToInstanceMap">B</A>> 182<BR> 183T</CODE></FONT></TD> 184</TR> 185</TABLE> 186</CODE></FONT></TD> 187<TD><CODE><B><A HREF="../../../../com/google/common/collect/ClassToInstanceMap.html#putInstance(java.lang.Class, T)">putInstance</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><T> type, 188 T value)</CODE> 189 190<BR> 191 Maps the specified class to the specified value.</TD> 192</TR> 193</TABLE> 194 <A NAME="methods_inherited_from_class_java.util.Map"><!-- --></A> 195<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 196<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 197<TH ALIGN="left"><B>Methods inherited from interface java.util.<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A></B></TH> 198</TR> 199<TR BGCOLOR="white" CLASS="TableRowColor"> 200<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#clear()" title="class or interface in java.util">clear</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#containsKey(java.lang.Object)" title="class or interface in java.util">containsKey</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#containsValue(java.lang.Object)" title="class or interface in java.util">containsValue</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#entrySet()" title="class or interface in java.util">entrySet</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.util">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#get(java.lang.Object)" title="class or interface in java.util">get</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#hashCode()" title="class or interface in java.util">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#isEmpty()" title="class or interface in java.util">isEmpty</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#keySet()" title="class or interface in java.util">keySet</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#put(K, V)" title="class or interface in java.util">put</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#putAll(java.util.Map)" title="class or interface in java.util">putAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#remove(java.lang.Object)" title="class or interface in java.util">remove</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#size()" title="class or interface in java.util">size</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#values()" title="class or interface in java.util">values</A></CODE></TD> 201</TR> 202</TABLE> 203 204<P> 205 206<!-- ============ METHOD DETAIL ========== --> 207 208<A NAME="method_detail"><!-- --></A> 209<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 210<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 211<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 212<B>Method Detail</B></FONT></TH> 213</TR> 214</TABLE> 215 216<A NAME="getInstance(java.lang.Class)"><!-- --></A><H3> 217getInstance</H3> 218<PRE> 219<T extends <A HREF="../../../../com/google/common/collect/ClassToInstanceMap.html" title="type parameter in ClassToInstanceMap">B</A>> T <B>getInstance</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><T> type)</PRE> 220<DL> 221<DD>Returns the value the specified class is mapped to, or <code>null</code> if no 222 entry for this class is present. This will only return a value that was 223 bound to this specific class, not a value that may have been bound to a 224 subtype. 225<P> 226<DD><DL> 227</DL> 228</DD> 229<DD><DL> 230</DL> 231</DD> 232</DL> 233<HR> 234 235<A NAME="putInstance(java.lang.Class,java.lang.Object)"><!-- --></A><A NAME="putInstance(java.lang.Class, T)"><!-- --></A><H3> 236putInstance</H3> 237<PRE> 238<T extends <A HREF="../../../../com/google/common/collect/ClassToInstanceMap.html" title="type parameter in ClassToInstanceMap">B</A>> T <B>putInstance</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><T> type, 239 <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> 240 T value)</PRE> 241<DL> 242<DD>Maps the specified class to the specified value. Does <i>not</i> associate 243 this value with any of the class's supertypes. 244<P> 245<DD><DL> 246</DL> 247</DD> 248<DD><DL> 249 250<DT><B>Returns:</B><DD>the value previously associated with this class (possibly <code>null</code>), or <code>null</code> if there was no previous entry.</DL> 251</DD> 252</DL> 253<!-- ========= END OF CLASS DATA ========= --> 254<HR> 255 256 257<!-- ======= START OF BOTTOM NAVBAR ====== --> 258<A NAME="navbar_bottom"><!-- --></A> 259<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> 260<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 261<TR> 262<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 263<A NAME="navbar_bottom_firstrow"><!-- --></A> 264<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 265 <TR ALIGN="center" VALIGN="top"> 266 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 267 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 268 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 269 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ClassToInstanceMap.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 270 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 271 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 272 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 273 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 274 </TR> 275</TABLE> 276</TD> 277<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 278</EM> 279</TD> 280</TR> 281 282<TR> 283<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 284 <A HREF="../../../../com/google/common/collect/BiMap.html" title="interface in com.google.common.collect"><B>PREV CLASS</B></A> 285 <A HREF="../../../../com/google/common/collect/Collections2.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD> 286<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 287 <A HREF="../../../../index.html?com/google/common/collect/ClassToInstanceMap.html" target="_top"><B>FRAMES</B></A> 288 <A HREF="ClassToInstanceMap.html" target="_top"><B>NO FRAMES</B></A> 289 <SCRIPT type="text/javascript"> 290 <!-- 291 if(window==top) { 292 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); 293 } 294 //--> 295</SCRIPT> 296<NOSCRIPT> 297 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> 298</NOSCRIPT> 299 300 301</FONT></TD> 302</TR> 303<TR> 304<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 305 SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> 306<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 307DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> 308</TR> 309</TABLE> 310<A NAME="skip-navbar_bottom"></A> 311<!-- ======== END OF BOTTOM NAVBAR ======= --> 312 313<HR> 314 315</BODY> 316</HTML> 317