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:59 PST 2010 --> 6<TITLE> 7ObjectArrays (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="ObjectArrays (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/ObjectArrays.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/MutableClassToInstanceMap.html" title="class in com.google.common.collect"><B>PREV CLASS</B></A> 59 <A HREF="../../../../com/google/common/collect/Ordering.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/ObjectArrays.html" target="_top"><B>FRAMES</B></A> 62 <A HREF="ObjectArrays.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> 93Class ObjectArrays</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.collect.ObjectArrays</B> 97</PRE> 98<HR> 99<DL> 100<DT><PRE>public final class <B>ObjectArrays</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> 104Static utility methods pertaining to object arrays. 105<P> 106 107<P> 108<DL> 109<DT><B>Since:</B></DT> 110 <DD>2010.01.04 <b>stable</b> (imported from Google Collections Library)</DD> 111<DT><B>Author:</B></DT> 112 <DD>Kevin Bourrillion</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> T[]</CODE></FONT></TD> 133</TR> 134</TABLE> 135</CODE></FONT></TD> 136<TD><CODE><B><A HREF="../../../../com/google/common/collect/ObjectArrays.html#concat(T[], T)">concat</A></B>(T[] array, 137 T element)</CODE> 138 139<BR> 140 Returns a new array that appends <code>element</code> to <code>array</code>.</TD> 141</TR> 142<TR BGCOLOR="white" CLASS="TableRowColor"> 143<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 144<CODE>static 145<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 146<TR ALIGN="right" VALIGN=""> 147<TD NOWRAP><FONT SIZE="-1"> 148<CODE><T> T[]</CODE></FONT></TD> 149</TR> 150</TABLE> 151</CODE></FONT></TD> 152<TD><CODE><B><A HREF="../../../../com/google/common/collect/ObjectArrays.html#concat(T[], T[], java.lang.Class)">concat</A></B>(T[] first, 153 T[] second, 154 <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> 155 156<BR> 157 Returns a new array that contains the concatenated contents of two arrays.</TD> 158</TR> 159<TR BGCOLOR="white" CLASS="TableRowColor"> 160<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 161<CODE>static 162<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 163<TR ALIGN="right" VALIGN=""> 164<TD NOWRAP><FONT SIZE="-1"> 165<CODE><T> T[]</CODE></FONT></TD> 166</TR> 167</TABLE> 168</CODE></FONT></TD> 169<TD><CODE><B><A HREF="../../../../com/google/common/collect/ObjectArrays.html#concat(T, T[])">concat</A></B>(T element, 170 T[] array)</CODE> 171 172<BR> 173 Returns a new array that prepends <code>element</code> to <code>array</code>.</TD> 174</TR> 175<TR BGCOLOR="white" CLASS="TableRowColor"> 176<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 177<CODE>static 178<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 179<TR ALIGN="right" VALIGN=""> 180<TD NOWRAP><FONT SIZE="-1"> 181<CODE><T> T[]</CODE></FONT></TD> 182</TR> 183</TABLE> 184</CODE></FONT></TD> 185<TD><CODE><B><A HREF="../../../../com/google/common/collect/ObjectArrays.html#newArray(java.lang.Class, int)">newArray</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, 186 int length)</CODE> 187 188<BR> 189 Returns a new array of the given length with the specified component type.</TD> 190</TR> 191<TR BGCOLOR="white" CLASS="TableRowColor"> 192<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 193<CODE>static 194<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 195<TR ALIGN="right" VALIGN=""> 196<TD NOWRAP><FONT SIZE="-1"> 197<CODE><T> T[]</CODE></FONT></TD> 198</TR> 199</TABLE> 200</CODE></FONT></TD> 201<TD><CODE><B><A HREF="../../../../com/google/common/collect/ObjectArrays.html#newArray(T[], int)">newArray</A></B>(T[] reference, 202 int length)</CODE> 203 204<BR> 205 Returns a new array of the given length with the same type as a reference 206 array.</TD> 207</TR> 208</TABLE> 209 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> 210<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 211<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 212<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> 213</TR> 214<TR BGCOLOR="white" CLASS="TableRowColor"> 215<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> 216</TR> 217</TABLE> 218 219<P> 220 221<!-- ============ METHOD DETAIL ========== --> 222 223<A NAME="method_detail"><!-- --></A> 224<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 225<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 226<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 227<B>Method Detail</B></FONT></TH> 228</TR> 229</TABLE> 230 231<A NAME="newArray(java.lang.Class, int)"><!-- --></A><H3> 232newArray</H3> 233<PRE> 234public static <T> T[] <B>newArray</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, 235 int length)</PRE> 236<DL> 237<DD>Returns a new array of the given length with the specified component type. 238<P> 239<DD><DL> 240<DT><B>Parameters:</B><DD><CODE>type</CODE> - the component type<DD><CODE>length</CODE> - the length of the new array</DL> 241</DD> 242</DL> 243<HR> 244 245<A NAME="newArray(java.lang.Object[],int)"><!-- --></A><A NAME="newArray(T[], int)"><!-- --></A><H3> 246newArray</H3> 247<PRE> 248public static <T> T[] <B>newArray</B>(T[] reference, 249 int length)</PRE> 250<DL> 251<DD>Returns a new array of the given length with the same type as a reference 252 array. 253<P> 254<DD><DL> 255<DT><B>Parameters:</B><DD><CODE>reference</CODE> - any array of the desired type<DD><CODE>length</CODE> - the length of the new array</DL> 256</DD> 257</DL> 258<HR> 259 260<A NAME="concat(java.lang.Object[],java.lang.Object[],java.lang.Class)"><!-- --></A><A NAME="concat(T[], T[], java.lang.Class)"><!-- --></A><H3> 261concat</H3> 262<PRE> 263public static <T> T[] <B>concat</B>(T[] first, 264 T[] second, 265 <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> 266<DL> 267<DD>Returns a new array that contains the concatenated contents of two arrays. 268<P> 269<DD><DL> 270<DT><B>Parameters:</B><DD><CODE>first</CODE> - the first array of elements to concatenate<DD><CODE>second</CODE> - the second array of elements to concatenate<DD><CODE>type</CODE> - the component type of the returned array</DL> 271</DD> 272</DL> 273<HR> 274 275<A NAME="concat(java.lang.Object,java.lang.Object[])"><!-- --></A><A NAME="concat(T, T[])"><!-- --></A><H3> 276concat</H3> 277<PRE> 278public static <T> T[] <B>concat</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> 279 T element, 280 T[] array)</PRE> 281<DL> 282<DD>Returns a new array that prepends <code>element</code> to <code>array</code>. 283<P> 284<DD><DL> 285<DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to prepend to the front of <code>array</code><DD><CODE>array</CODE> - the array of elements to append 286<DT><B>Returns:</B><DD>an array whose size is one larger than <code>array</code>, with 287 <code>element</code> occupying the first position, and the 288 elements of <code>array</code> occupying the remaining elements.</DL> 289</DD> 290</DL> 291<HR> 292 293<A NAME="concat(java.lang.Object[],java.lang.Object)"><!-- --></A><A NAME="concat(T[], T)"><!-- --></A><H3> 294concat</H3> 295<PRE> 296public static <T> T[] <B>concat</B>(T[] array, 297 <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> 298 T element)</PRE> 299<DL> 300<DD>Returns a new array that appends <code>element</code> to <code>array</code>. 301<P> 302<DD><DL> 303<DT><B>Parameters:</B><DD><CODE>array</CODE> - the array of elements to prepend<DD><CODE>element</CODE> - the element to append to the end 304<DT><B>Returns:</B><DD>an array whose size is one larger than <code>array</code>, with 305 the same contents as <code>array</code>, plus <code>element</code> occupying the 306 last position.</DL> 307</DD> 308</DL> 309<!-- ========= END OF CLASS DATA ========= --> 310<HR> 311 312 313<!-- ======= START OF BOTTOM NAVBAR ====== --> 314<A NAME="navbar_bottom"><!-- --></A> 315<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> 316<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 317<TR> 318<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 319<A NAME="navbar_bottom_firstrow"><!-- --></A> 320<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 321 <TR ALIGN="center" VALIGN="top"> 322 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 323 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 324 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 325 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ObjectArrays.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 326 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 327 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 328 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 329 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 330 </TR> 331</TABLE> 332</TD> 333<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 334</EM> 335</TD> 336</TR> 337 338<TR> 339<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 340 <A HREF="../../../../com/google/common/collect/MutableClassToInstanceMap.html" title="class in com.google.common.collect"><B>PREV CLASS</B></A> 341 <A HREF="../../../../com/google/common/collect/Ordering.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD> 342<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 343 <A HREF="../../../../index.html?com/google/common/collect/ObjectArrays.html" target="_top"><B>FRAMES</B></A> 344 <A HREF="ObjectArrays.html" target="_top"><B>NO FRAMES</B></A> 345 <SCRIPT type="text/javascript"> 346 <!-- 347 if(window==top) { 348 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); 349 } 350 //--> 351</SCRIPT> 352<NOSCRIPT> 353 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> 354</NOSCRIPT> 355 356 357</FONT></TD> 358</TR> 359<TR> 360<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 361 SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> 362<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 363DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> 364</TR> 365</TABLE> 366<A NAME="skip-navbar_bottom"></A> 367<!-- ======== END OF BOTTOM NAVBAR ======= --> 368 369<HR> 370 371</BODY> 372</HTML> 373