Home | History | Annotate | Download | only in base
      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:56 PST 2010 -->
      6 <TITLE>
      7 Defaults (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="Defaults (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>&nbsp;</TD>
     41   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
     42   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
     43   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Defaults.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
     44   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
     45   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
     46   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
     47   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</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 &nbsp;<A HREF="../../../../com/google/common/base/Charsets.html" title="class in com.google.common.base"><B>PREV CLASS</B></A>&nbsp;
     59 &nbsp;<A HREF="../../../../com/google/common/base/FinalizablePhantomReference.html" title="class in com.google.common.base"><B>NEXT CLASS</B></A></FONT></TD>
     60 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
     61   <A HREF="../../../../index.html?com/google/common/base/Defaults.html" target="_top"><B>FRAMES</B></A>  &nbsp;
     62 &nbsp;<A HREF="Defaults.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
     63 &nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
     80 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
     81 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<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.base</FONT>
     92 <BR>
     93 Class Defaults</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.base.Defaults</B>
     97 </PRE>
     98 <HR>
     99 <DL>
    100 <DT><PRE>public final class <B>Defaults</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 This class provides default values for all Java types, as defined by the JLS.
    105 <P>
    106 
    107 <P>
    108 <DL>
    109 <DT><B>Author:</B></DT>
    110   <DD>Ben Yu</DD>
    111 </DL>
    112 <HR>
    113 
    114 <P>
    115 
    116 <!-- ========== METHOD SUMMARY =========== -->
    117 
    118 <A NAME="method_summary"><!-- --></A>
    119 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    120 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    121 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
    122 <B>Method Summary</B></FONT></TH>
    123 </TR>
    124 <TR BGCOLOR="white" CLASS="TableRowColor">
    125 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    126 <CODE>static
    127 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
    128 <TR ALIGN="right" VALIGN="">
    129 <TD NOWRAP><FONT SIZE="-1">
    130 <CODE>&lt;T&gt; T</CODE></FONT></TD>
    131 </TR>
    132 </TABLE>
    133 </CODE></FONT></TD>
    134 <TD><CODE><B><A HREF="../../../../com/google/common/base/Defaults.html#defaultValue(java.lang.Class)">defaultValue</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>&lt;T&gt;&nbsp;type)</CODE>
    135 
    136 <BR>
    137 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the default value of <code>type</code> as defined by JLS --- <code>0</code>
    138  for numbers, <code>false</code> for <code>boolean</code> and <code>'\0'</code> for <code>char</code>.</TD>
    139 </TR>
    140 </TABLE>
    141 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
    142 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    143 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
    144 <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>
    145 </TR>
    146 <TR BGCOLOR="white" CLASS="TableRowColor">
    147 <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>
    148 </TR>
    149 </TABLE>
    150 &nbsp;
    151 <P>
    152 
    153 <!-- ============ METHOD DETAIL ========== -->
    154 
    155 <A NAME="method_detail"><!-- --></A>
    156 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    157 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    158 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
    159 <B>Method Detail</B></FONT></TH>
    160 </TR>
    161 </TABLE>
    162 
    163 <A NAME="defaultValue(java.lang.Class)"><!-- --></A><H3>
    164 defaultValue</H3>
    165 <PRE>
    166 public static &lt;T&gt; T <B>defaultValue</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>&lt;T&gt;&nbsp;type)</PRE>
    167 <DL>
    168 <DD>Returns the default value of <code>type</code> as defined by JLS --- <code>0</code>
    169  for numbers, <code>false</code> for <code>boolean</code> and <code>'\0'</code> for <code>char</code>. For non-primitive types and <code>void</code>, null is returned.
    170 <P>
    171 <DD><DL>
    172 </DL>
    173 </DD>
    174 </DL>
    175 <!-- ========= END OF CLASS DATA ========= -->
    176 <HR>
    177 
    178 
    179 <!-- ======= START OF BOTTOM NAVBAR ====== -->
    180 <A NAME="navbar_bottom"><!-- --></A>
    181 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
    182 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
    183 <TR>
    184 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
    185 <A NAME="navbar_bottom_firstrow"><!-- --></A>
    186 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
    187   <TR ALIGN="center" VALIGN="top">
    188   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
    189   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
    190   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
    191   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Defaults.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
    192   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
    193   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
    194   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
    195   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
    196   </TR>
    197 </TABLE>
    198 </TD>
    199 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
    200 </EM>
    201 </TD>
    202 </TR>
    203 
    204 <TR>
    205 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
    206 &nbsp;<A HREF="../../../../com/google/common/base/Charsets.html" title="class in com.google.common.base"><B>PREV CLASS</B></A>&nbsp;
    207 &nbsp;<A HREF="../../../../com/google/common/base/FinalizablePhantomReference.html" title="class in com.google.common.base"><B>NEXT CLASS</B></A></FONT></TD>
    208 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
    209   <A HREF="../../../../index.html?com/google/common/base/Defaults.html" target="_top"><B>FRAMES</B></A>  &nbsp;
    210 &nbsp;<A HREF="Defaults.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
    211 &nbsp;<SCRIPT type="text/javascript">
    212   <!--
    213   if(window==top) {
    214     document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
    215   }
    216   //-->
    217 </SCRIPT>
    218 <NOSCRIPT>
    219   <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
    220 </NOSCRIPT>
    221 
    222 
    223 </FONT></TD>
    224 </TR>
    225 <TR>
    226 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
    227   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
    228 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
    229 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
    230 </TR>
    231 </TABLE>
    232 <A NAME="skip-navbar_bottom"></A>
    233 <!-- ======== END OF BOTTOM NAVBAR ======= -->
    234 
    235 <HR>
    236 
    237 </BODY>
    238 </HTML>
    239