• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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>
7Floats (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="Floats (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/Floats.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/primitives/Doubles.html" title="class in com.google.common.primitives"><B>PREV CLASS</B></A>&nbsp;
59&nbsp;<A HREF="../../../../com/google/common/primitives/Ints.html" title="class in com.google.common.primitives"><B>NEXT CLASS</B></A></FONT></TD>
60<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61  <A HREF="../../../../index.html?com/google/common/primitives/Floats.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="Floats.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">
81DETAIL:&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">
91com.google.common.primitives</FONT>
92<BR>
93Class Floats</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.primitives.Floats</B>
97</PRE>
98<HR>
99<DL>
100<DT><PRE>public final class <B>Floats</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 <code>float</code> primitives, that are not
105 already found in either <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Float.html?is-external=true" title="class or interface in java.lang"><CODE>Float</CODE></A> or <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Arrays.html?is-external=true" title="class or interface in java.util"><CODE>Arrays</CODE></A>.
106<P>
107
108<P>
109<DL>
110<DT><B>Since:</B></DT>
111  <DD>2009.09.15 <b>tentative</b></DD>
112<DT><B>Author:</B></DT>
113  <DD>Kevin Bourrillion</DD>
114</DL>
115<HR>
116
117<P>
118
119<!-- ========== METHOD SUMMARY =========== -->
120
121<A NAME="method_summary"><!-- --></A>
122<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
123<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
124<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
125<B>Method Summary</B></FONT></TH>
126</TR>
127<TR BGCOLOR="white" CLASS="TableRowColor">
128<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
129<CODE>static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Float.html?is-external=true" title="class or interface in java.lang">Float</A>&gt;</CODE></FONT></TD>
130<TD><CODE><B><A HREF="../../../../com/google/common/primitives/Floats.html#asList(float...)">asList</A></B>(float...&nbsp;backingArray)</CODE>
131
132<BR>
133&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a fixed-size list backed by the specified array, similar to <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Arrays.html?is-external=true#asList(T...)" title="class or interface in java.util"><CODE>Arrays.asList(Object[])</CODE></A>.</TD>
134</TR>
135<TR BGCOLOR="white" CLASS="TableRowColor">
136<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
137<CODE>static&nbsp;int</CODE></FONT></TD>
138<TD><CODE><B><A HREF="../../../../com/google/common/primitives/Floats.html#compare(float, float)">compare</A></B>(float&nbsp;a,
139        float&nbsp;b)</CODE>
140
141<BR>
142&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compares the two specified <code>float</code> values using <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Float.html?is-external=true#compare(float, float)" title="class or interface in java.lang"><CODE>Float.compare(float, float)</CODE></A>.</TD>
143</TR>
144<TR BGCOLOR="white" CLASS="TableRowColor">
145<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
146<CODE>static&nbsp;float[]</CODE></FONT></TD>
147<TD><CODE><B><A HREF="../../../../com/google/common/primitives/Floats.html#concat(float[]...)">concat</A></B>(float[]...&nbsp;arrays)</CODE>
148
149<BR>
150&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the values from each provided array combined into a single array.</TD>
151</TR>
152<TR BGCOLOR="white" CLASS="TableRowColor">
153<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
154<CODE>static&nbsp;boolean</CODE></FONT></TD>
155<TD><CODE><B><A HREF="../../../../com/google/common/primitives/Floats.html#contains(float[], float)">contains</A></B>(float[]&nbsp;array,
156         float&nbsp;target)</CODE>
157
158<BR>
159&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if <code>target</code> is present as an element anywhere in
160 <code>array</code>.</TD>
161</TR>
162<TR BGCOLOR="white" CLASS="TableRowColor">
163<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
164<CODE>static&nbsp;float[]</CODE></FONT></TD>
165<TD><CODE><B><A HREF="../../../../com/google/common/primitives/Floats.html#ensureCapacity(float[], int, int)">ensureCapacity</A></B>(float[]&nbsp;array,
166               int&nbsp;minLength,
167               int&nbsp;padding)</CODE>
168
169<BR>
170&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array containing the same values as <code>array</code>, but
171 guaranteed to be of a specified minimum length.</TD>
172</TR>
173<TR BGCOLOR="white" CLASS="TableRowColor">
174<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
175<CODE>static&nbsp;int</CODE></FONT></TD>
176<TD><CODE><B><A HREF="../../../../com/google/common/primitives/Floats.html#hashCode(float)">hashCode</A></B>(float&nbsp;value)</CODE>
177
178<BR>
179&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a hash code for <code>value</code>; equal to the result of invoking
180 <code>((Float) value).hashCode()</code>.</TD>
181</TR>
182<TR BGCOLOR="white" CLASS="TableRowColor">
183<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
184<CODE>static&nbsp;int</CODE></FONT></TD>
185<TD><CODE><B><A HREF="../../../../com/google/common/primitives/Floats.html#indexOf(float[], float)">indexOf</A></B>(float[]&nbsp;array,
186        float&nbsp;target)</CODE>
187
188<BR>
189&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index of the first appearance of the value <code>target</code> in
190 <code>array</code>.</TD>
191</TR>
192<TR BGCOLOR="white" CLASS="TableRowColor">
193<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
194<CODE>static&nbsp;int</CODE></FONT></TD>
195<TD><CODE><B><A HREF="../../../../com/google/common/primitives/Floats.html#indexOf(float[], float[])">indexOf</A></B>(float[]&nbsp;array,
196        float[]&nbsp;target)</CODE>
197
198<BR>
199&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the start position of the first occurrence of the specified <code>target</code> within <code>array</code>, or <code>-1</code> if there is no such occurrence.</TD>
200</TR>
201<TR BGCOLOR="white" CLASS="TableRowColor">
202<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
203<CODE>static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
204<TD><CODE><B><A HREF="../../../../com/google/common/primitives/Floats.html#join(java.lang.String, float...)">join</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;separator,
205     float...&nbsp;array)</CODE>
206
207<BR>
208&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a string containing the supplied <code>float</code> values, converted
209 to strings as specified by <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Float.html?is-external=true#toString(float)" title="class or interface in java.lang"><CODE>Float.toString(float)</CODE></A>, and separated by
210 <code>separator</code>.</TD>
211</TR>
212<TR BGCOLOR="white" CLASS="TableRowColor">
213<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
214<CODE>static&nbsp;int</CODE></FONT></TD>
215<TD><CODE><B><A HREF="../../../../com/google/common/primitives/Floats.html#lastIndexOf(float[], float)">lastIndexOf</A></B>(float[]&nbsp;array,
216            float&nbsp;target)</CODE>
217
218<BR>
219&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index of the last appearance of the value <code>target</code> in
220 <code>array</code>.</TD>
221</TR>
222<TR BGCOLOR="white" CLASS="TableRowColor">
223<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
224<CODE>static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A>&lt;float[]&gt;</CODE></FONT></TD>
225<TD><CODE><B><A HREF="../../../../com/google/common/primitives/Floats.html#lexicographicalComparator()">lexicographicalComparator</A></B>()</CODE>
226
227<BR>
228&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a comparator that compares two <code>float</code> arrays
229 lexicographically.</TD>
230</TR>
231<TR BGCOLOR="white" CLASS="TableRowColor">
232<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
233<CODE>static&nbsp;float</CODE></FONT></TD>
234<TD><CODE><B><A HREF="../../../../com/google/common/primitives/Floats.html#max(float...)">max</A></B>(float...&nbsp;array)</CODE>
235
236<BR>
237&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the greatest value present in <code>array</code>, using the same rules
238 of comparison as <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Math.html?is-external=true#min(float, float)" title="class or interface in java.lang"><CODE>Math.min(float, float)</CODE></A>.</TD>
239</TR>
240<TR BGCOLOR="white" CLASS="TableRowColor">
241<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
242<CODE>static&nbsp;float</CODE></FONT></TD>
243<TD><CODE><B><A HREF="../../../../com/google/common/primitives/Floats.html#min(float...)">min</A></B>(float...&nbsp;array)</CODE>
244
245<BR>
246&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the least value present in <code>array</code>, using the same rules of
247 comparison as <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Math.html?is-external=true#min(float, float)" title="class or interface in java.lang"><CODE>Math.min(float, float)</CODE></A>.</TD>
248</TR>
249<TR BGCOLOR="white" CLASS="TableRowColor">
250<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
251<CODE>static&nbsp;float[]</CODE></FONT></TD>
252<TD><CODE><B><A HREF="../../../../com/google/common/primitives/Floats.html#toArray(java.util.Collection)">toArray</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Float.html?is-external=true" title="class or interface in java.lang">Float</A>&gt;&nbsp;collection)</CODE>
253
254<BR>
255&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Copies a collection of <code>Float</code> instances into a new array of
256 primitive <code>float</code> values.</TD>
257</TR>
258</TABLE>
259&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
260<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
261<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
262<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>
263</TR>
264<TR BGCOLOR="white" CLASS="TableRowColor">
265<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>
266</TR>
267</TABLE>
268&nbsp;
269<P>
270
271<!-- ============ METHOD DETAIL ========== -->
272
273<A NAME="method_detail"><!-- --></A>
274<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
275<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
276<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
277<B>Method Detail</B></FONT></TH>
278</TR>
279</TABLE>
280
281<A NAME="hashCode(float)"><!-- --></A><H3>
282hashCode</H3>
283<PRE>
284public static int <B>hashCode</B>(float&nbsp;value)</PRE>
285<DL>
286<DD>Returns a hash code for <code>value</code>; equal to the result of invoking
287 <code>((Float) value).hashCode()</code>.
288<P>
289<DD><DL>
290<DT><B>Parameters:</B><DD><CODE>value</CODE> - a primitive <code>float</code> value
291<DT><B>Returns:</B><DD>a hash code for the value</DL>
292</DD>
293</DL>
294<HR>
295
296<A NAME="compare(float, float)"><!-- --></A><H3>
297compare</H3>
298<PRE>
299public static int <B>compare</B>(float&nbsp;a,
300                          float&nbsp;b)</PRE>
301<DL>
302<DD>Compares the two specified <code>float</code> values using <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Float.html?is-external=true#compare(float, float)" title="class or interface in java.lang"><CODE>Float.compare(float, float)</CODE></A>. You may prefer to invoke that method
303 directly; this method exists only for consistency with the other utilities
304 in this package.
305<P>
306<DD><DL>
307<DT><B>Parameters:</B><DD><CODE>a</CODE> - the first <code>float</code> to compare<DD><CODE>b</CODE> - the second <code>float</code> to compare
308<DT><B>Returns:</B><DD>the result of invoking <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Float.html?is-external=true#compare(float, float)" title="class or interface in java.lang"><CODE>Float.compare(float, float)</CODE></A></DL>
309</DD>
310</DL>
311<HR>
312
313<A NAME="contains(float[], float)"><!-- --></A><H3>
314contains</H3>
315<PRE>
316public static boolean <B>contains</B>(float[]&nbsp;array,
317                               float&nbsp;target)</PRE>
318<DL>
319<DD>Returns <code>true</code> if <code>target</code> is present as an element anywhere in
320 <code>array</code>. Note that this always returns <code>false</code> when <code>target</code> is <code>NaN</code>.
321<P>
322<DD><DL>
323<DT><B>Parameters:</B><DD><CODE>array</CODE> - an array of <code>float</code> values, possibly empty<DD><CODE>target</CODE> - a primitive <code>float</code> value
324<DT><B>Returns:</B><DD><code>true</code> if <code>array[i] == target</code> for some value of <code>i</code></DL>
325</DD>
326</DL>
327<HR>
328
329<A NAME="indexOf(float[], float)"><!-- --></A><H3>
330indexOf</H3>
331<PRE>
332public static int <B>indexOf</B>(float[]&nbsp;array,
333                          float&nbsp;target)</PRE>
334<DL>
335<DD>Returns the index of the first appearance of the value <code>target</code> in
336 <code>array</code>. Note that this always returns <code>-1</code> when <code>target</code>
337 is <code>NaN</code>.
338<P>
339<DD><DL>
340<DT><B>Parameters:</B><DD><CODE>array</CODE> - an array of <code>float</code> values, possibly empty<DD><CODE>target</CODE> - a primitive <code>float</code> value
341<DT><B>Returns:</B><DD>the least index <code>i</code> for which <code>array[i] == target</code>, or
342     <code>-1</code> if no such index exists.</DL>
343</DD>
344</DL>
345<HR>
346
347<A NAME="indexOf(float[], float[])"><!-- --></A><H3>
348indexOf</H3>
349<PRE>
350public static int <B>indexOf</B>(float[]&nbsp;array,
351                          float[]&nbsp;target)</PRE>
352<DL>
353<DD>Returns the start position of the first occurrence of the specified <code>target</code> within <code>array</code>, or <code>-1</code> if there is no such occurrence.
354
355 <p>More formally, returns the lowest index <code>i</code> such that <code>java.util.Arrays.copyOfRange(array, i, i + target.length)</code> contains exactly
356 the same elements as <code>target</code>.
357
358 <p>Note that this always returns <code>-1</code> when <code>target</code> contains
359 <code>NaN</code>.
360<P>
361<DD><DL>
362<DT><B>Parameters:</B><DD><CODE>array</CODE> - the array to search for the sequence <code>target</code><DD><CODE>target</CODE> - the array to search for as a sub-sequence of <code>array</code></DL>
363</DD>
364</DL>
365<HR>
366
367<A NAME="lastIndexOf(float[], float)"><!-- --></A><H3>
368lastIndexOf</H3>
369<PRE>
370public static int <B>lastIndexOf</B>(float[]&nbsp;array,
371                              float&nbsp;target)</PRE>
372<DL>
373<DD>Returns the index of the last appearance of the value <code>target</code> in
374 <code>array</code>. Note that this always returns <code>-1</code> when <code>target</code>
375 is <code>NaN</code>.
376<P>
377<DD><DL>
378<DT><B>Parameters:</B><DD><CODE>array</CODE> - an array of <code>float</code> values, possibly empty<DD><CODE>target</CODE> - a primitive <code>float</code> value
379<DT><B>Returns:</B><DD>the greatest index <code>i</code> for which <code>array[i] == target</code>,
380     or <code>-1</code> if no such index exists.</DL>
381</DD>
382</DL>
383<HR>
384
385<A NAME="min(float...)"><!-- --></A><H3>
386min</H3>
387<PRE>
388public static float <B>min</B>(float...&nbsp;array)</PRE>
389<DL>
390<DD>Returns the least value present in <code>array</code>, using the same rules of
391 comparison as <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Math.html?is-external=true#min(float, float)" title="class or interface in java.lang"><CODE>Math.min(float, float)</CODE></A>.
392<P>
393<DD><DL>
394<DT><B>Parameters:</B><DD><CODE>array</CODE> - a <i>nonempty</i> array of <code>float</code> values
395<DT><B>Returns:</B><DD>the value present in <code>array</code> that is less than or equal to
396     every other value in the array
397<DT><B>Throws:</B>
398<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if <code>array</code> is empty</DL>
399</DD>
400</DL>
401<HR>
402
403<A NAME="max(float...)"><!-- --></A><H3>
404max</H3>
405<PRE>
406public static float <B>max</B>(float...&nbsp;array)</PRE>
407<DL>
408<DD>Returns the greatest value present in <code>array</code>, using the same rules
409 of comparison as <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Math.html?is-external=true#min(float, float)" title="class or interface in java.lang"><CODE>Math.min(float, float)</CODE></A>.
410<P>
411<DD><DL>
412<DT><B>Parameters:</B><DD><CODE>array</CODE> - a <i>nonempty</i> array of <code>float</code> values
413<DT><B>Returns:</B><DD>the value present in <code>array</code> that is greater than or equal to
414     every other value in the array
415<DT><B>Throws:</B>
416<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if <code>array</code> is empty</DL>
417</DD>
418</DL>
419<HR>
420
421<A NAME="concat(float[]...)"><!-- --></A><H3>
422concat</H3>
423<PRE>
424public static float[] <B>concat</B>(float[]...&nbsp;arrays)</PRE>
425<DL>
426<DD>Returns the values from each provided array combined into a single array.
427 For example, <code>concat(new float[] {a, b}, new float[] {}, new
428 float[] {c}</code> returns the array <code>{a, b, c}</code>.
429<P>
430<DD><DL>
431<DT><B>Parameters:</B><DD><CODE>arrays</CODE> - zero or more <code>float</code> arrays
432<DT><B>Returns:</B><DD>a single array containing all the values from the source arrays, in
433     order</DL>
434</DD>
435</DL>
436<HR>
437
438<A NAME="ensureCapacity(float[], int, int)"><!-- --></A><H3>
439ensureCapacity</H3>
440<PRE>
441public static float[] <B>ensureCapacity</B>(float[]&nbsp;array,
442                                     int&nbsp;minLength,
443                                     int&nbsp;padding)</PRE>
444<DL>
445<DD>Returns an array containing the same values as <code>array</code>, but
446 guaranteed to be of a specified minimum length. If <code>array</code> already
447 has a length of at least <code>minLength</code>, it is returned directly.
448 Otherwise, a new array of size <code>minLength + padding</code> is returned,
449 containing the values of <code>array</code>, and zeroes in the remaining places.
450<P>
451<DD><DL>
452<DT><B>Parameters:</B><DD><CODE>array</CODE> - the source array<DD><CODE>minLength</CODE> - the minimum length the returned array must guarantee<DD><CODE>padding</CODE> - an extra amount to "grow" the array by if growth is
453     necessary
454<DT><B>Returns:</B><DD>an array containing the values of <code>array</code>, with guaranteed
455     minimum length <code>minLength</code>
456<DT><B>Throws:</B>
457<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if <code>minLength</code> or <code>padding</code> is
458     negative</DL>
459</DD>
460</DL>
461<HR>
462
463<A NAME="join(java.lang.String, float...)"><!-- --></A><H3>
464join</H3>
465<PRE>
466public static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>join</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;separator,
467                          float...&nbsp;array)</PRE>
468<DL>
469<DD>Returns a string containing the supplied <code>float</code> values, converted
470 to strings as specified by <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Float.html?is-external=true#toString(float)" title="class or interface in java.lang"><CODE>Float.toString(float)</CODE></A>, and separated by
471 <code>separator</code>. For example, <code>join("-", 1.0f, 2.0f, 3.0f)</code>
472 returns the string <code>"1.0-2.0-3.0"</code>.
473<P>
474<DD><DL>
475<DT><B>Parameters:</B><DD><CODE>separator</CODE> - the text that should appear between consecutive values in
476     the resulting string (but not at the start or end)<DD><CODE>array</CODE> - an array of <code>float</code> values, possibly empty</DL>
477</DD>
478</DL>
479<HR>
480
481<A NAME="lexicographicalComparator()"><!-- --></A><H3>
482lexicographicalComparator</H3>
483<PRE>
484public static <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A>&lt;float[]&gt; <B>lexicographicalComparator</B>()</PRE>
485<DL>
486<DD>Returns a comparator that compares two <code>float</code> arrays
487 lexicographically. That is, it compares, using <A HREF="../../../../com/google/common/primitives/Floats.html#compare(float, float)"><CODE>compare(float, float)</CODE></A>), the first pair of values that follow any
488 common prefix, or when one array is a prefix of the other, treats the
489 shorter array as the lesser. For example, <code>[] &lt; [1.0f] &lt; [1.0f, 2.0f]
490 &lt; [2.0f]</code>.
491
492 <p>The returned comparator is inconsistent with <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"><CODE>Object.equals(Object)</CODE></A> (since arrays support only identity equality), but
493 it is consistent with <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Arrays.html?is-external=true#equals(float[], float[])" title="class or interface in java.util"><CODE>Arrays.equals(float[], float[])</CODE></A>.
494<P>
495<DD><DL>
496<DT><B>Since:</B></DT>
497  <DD>2010.01.04 <b>tentative</b></DD>
498<DT><B>See Also:</B><DD><a href="http://en.wikipedia.org/wiki/Lexicographical_order">
499     Lexicographical order</a> article at Wikipedia</DL>
500</DD>
501</DL>
502<HR>
503
504<A NAME="toArray(java.util.Collection)"><!-- --></A><H3>
505toArray</H3>
506<PRE>
507public static float[] <B>toArray</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Float.html?is-external=true" title="class or interface in java.lang">Float</A>&gt;&nbsp;collection)</PRE>
508<DL>
509<DD>Copies a collection of <code>Float</code> instances into a new array of
510 primitive <code>float</code> values.
511
512 <p>Elements are copied from the argument collection as if by <code>collection.toArray()</code>.  Calling this method is as thread-safe as calling
513 that method.
514<P>
515<DD><DL>
516<DT><B>Parameters:</B><DD><CODE>collection</CODE> - a collection of <code>Float</code> objects
517<DT><B>Returns:</B><DD>an array containing the same values as <code>collection</code>, in the
518     same order, converted to primitives
519<DT><B>Throws:</B>
520<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</A></CODE> - if <code>collection</code> or any of its elements
521     is null</DL>
522</DD>
523</DL>
524<HR>
525
526<A NAME="asList(float...)"><!-- --></A><H3>
527asList</H3>
528<PRE>
529public static <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Float.html?is-external=true" title="class or interface in java.lang">Float</A>&gt; <B>asList</B>(float...&nbsp;backingArray)</PRE>
530<DL>
531<DD>Returns a fixed-size list backed by the specified array, similar to <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Arrays.html?is-external=true#asList(T...)" title="class or interface in java.util"><CODE>Arrays.asList(Object[])</CODE></A>. The list supports <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true#set(int, E)" title="class or interface in java.util"><CODE>List.set(int, Object)</CODE></A>,
532 but any attempt to set a value to <code>null</code> will result in a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><CODE>NullPointerException</CODE></A>.
533
534 <p>The returned list maintains the values, but not the identities, of
535 <code>Float</code> objects written to or read from it.  For example, whether
536 <code>list.get(0) == list.get(0)</code> is true for the returned list is
537 unspecified.
538
539 <p>The returned list may have unexpected behavior if it contains <code>NaN</code>, or if <code>NaN</code> is used as a parameter to any of its methods.
540<P>
541<DD><DL>
542<DT><B>Parameters:</B><DD><CODE>backingArray</CODE> - the array to back the list
543<DT><B>Returns:</B><DD>a list view of the array</DL>
544</DD>
545</DL>
546<!-- ========= END OF CLASS DATA ========= -->
547<HR>
548
549
550<!-- ======= START OF BOTTOM NAVBAR ====== -->
551<A NAME="navbar_bottom"><!-- --></A>
552<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
553<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
554<TR>
555<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
556<A NAME="navbar_bottom_firstrow"><!-- --></A>
557<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
558  <TR ALIGN="center" VALIGN="top">
559  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
560  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
561  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
562  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Floats.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
563  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
564  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
565  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
566  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
567  </TR>
568</TABLE>
569</TD>
570<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
571</EM>
572</TD>
573</TR>
574
575<TR>
576<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
577&nbsp;<A HREF="../../../../com/google/common/primitives/Doubles.html" title="class in com.google.common.primitives"><B>PREV CLASS</B></A>&nbsp;
578&nbsp;<A HREF="../../../../com/google/common/primitives/Ints.html" title="class in com.google.common.primitives"><B>NEXT CLASS</B></A></FONT></TD>
579<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
580  <A HREF="../../../../index.html?com/google/common/primitives/Floats.html" target="_top"><B>FRAMES</B></A>  &nbsp;
581&nbsp;<A HREF="Floats.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
582&nbsp;<SCRIPT type="text/javascript">
583  <!--
584  if(window==top) {
585    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
586  }
587  //-->
588</SCRIPT>
589<NOSCRIPT>
590  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
591</NOSCRIPT>
592
593
594</FONT></TD>
595</TR>
596<TR>
597<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
598  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
599<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
600DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
601</TR>
602</TABLE>
603<A NAME="skip-navbar_bottom"></A>
604<!-- ======== END OF BOTTOM NAVBAR ======= -->
605
606<HR>
607
608</BODY>
609</HTML>
610