Lines Matching full:code
104 Static utility methods pertaining to <code>int</code> primitives, that are not
105 already found in either <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang"><CODE>Integer</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>.
128 <CODE>static int</CODE></FONT></TD>
129 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#BYTES">BYTES</A></B></CODE>
132 The number of bytes required to represent a primitive <code>int</code>
147 <CODE>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><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</A>></CODE></FONT></TD>
148 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#asList(int...)">asList</A></B>(int... backingArray)</CODE>
151 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>
155 <CODE>static int</CODE></FONT></TD>
156 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#checkedCast(long)">checkedCast</A></B>(long value)</CODE>
159 Returns the <code>int</code> value that is equal to <code>value</code>, if possible.</TD>
163 <CODE>static int</CODE></FONT></TD>
164 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#compare(int, int)">compare</A></B>(int a,
165 int b)</CODE>
168 Compares the two specified <code>int</code> values.</TD>
172 <CODE>static int[]</CODE></FONT></TD>
173 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#concat(int[]...)">concat</A></B>(int[]... arrays)</CODE>
180 <CODE>static boolean</CODE></FONT></TD>
181 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#contains(int[], int)">contains</A></B>(int[] array,
182 int target)</CODE>
185 Returns <code>true</code> if <code>target</code> is present as an element anywhere in
186 <code>array</code>.</TD>
190 <CODE>static int[]</CODE></FONT></TD>
191 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#ensureCapacity(int[], int, int)">ensureCapacity</A></B>(int[] array,
193 int padding)</CODE>
196 Returns an array containing the same values as <code>array</code>, but
201 <CODE>static int</CODE></FONT></TD>
202 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#fromByteArray(byte[])">fromByteArray</A></B>(byte[] bytes)</CODE>
205 Returns the <code>int</code> value whose big-endian representation is stored in
206 the first 4 bytes of <code>bytes</code>; equivalent to <code>ByteBuffer.wrap(bytes).getInt()</code>.</TD>
210 <CODE>static int</CODE></FONT></TD>
211 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#hashCode(int)">hashCode</A></B>(int value)</CODE>
214 Returns a hash code for <code>value</code>; equal to the result of invoking
215 <code>((Integer) value).hashCode()</code>.</TD>
219 <CODE>static int</CODE></FONT></TD>
220 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#indexOf(int[], int)">indexOf</A></B>(int[] array,
221 int target)</CODE>
224 Returns the index of the first appearance of the value <code>target</code> in
225 <code>array</code>.</TD>
229 <CODE>static int</CODE></FONT></TD>
230 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#indexOf(int[], int[])">indexOf</A></B>(int[] array,
231 int[] target)</CODE>
234 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>
238 <CODE>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></CODE></FONT></TD>
239 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#join(java.lang.String, int...)">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> separator,
240 int... array)</CODE>
243 Returns a string containing the supplied <code>int</code> values separated
244 by <code>separator</code>.</TD>
248 <CODE>static int</CODE></FONT></TD>
249 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#lastIndexOf(int[], int)">lastIndexOf</A></B>(int[] array,
250 int target)</CODE>
253 Returns the index of the last appearance of the value <code>target</code> in
254 <code>array</code>.</TD>
258 <CODE>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><int[]></CODE></FONT></TD>
259 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#lexicographicalComparator()">lexicographicalComparator</A></B>()</CODE>
262 Returns a comparator that compares two <code>int</code> arrays
267 <CODE>static int</CODE></FONT></TD>
268 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#max(int...)">max</A></B>(int... array)</CODE>
271 Returns the greatest value present in <code>array</code>.</TD>
275 <CODE>static int</CODE></FONT></TD>
276 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#min(int...)">min</A></B>(int... array)</CODE>
279 Returns the least value present in <code>array</code>.</TD>
283 <CODE>static int</CODE></FONT></TD>
284 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#saturatedCast(long)">saturatedCast</A></B>(long value)</CODE>
287 Returns the <code>int</code> nearest in value to <code>value</code>.</TD>
291 <CODE>static int[]</CODE></FONT></TD>
292 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.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><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</A>> collection)</CODE>
295 Copies a collection of <code>Integer</code> instances into a new array of
296 primitive <code>int</code> values.</TD>
300 <CODE>static byte[]</CODE></FONT></TD>
301 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Ints.html#toByteArray(int)">toByteArray</A></B>(int value)</CODE>
304 Returns a big-endian representation of <code>value</code> in a 4-element byte
305 array; equivalent to <code>ByteBuffer.allocate(4).putInt(value).array()</code>.</TD>
314 <TD><CODECODE></TD>
335 <DD>The number of bytes required to represent a primitive <code>int</code>
357 <DD>Returns a hash code for <code>value</code>; equal to the result of invoking
358 <code>((Integer) value).hashCode()</code>.
361 <DT><B>Parameters:</B><DD><CODE>value</CODE> - a primitive <code>int</code> value
362 <DT><B>Returns:</B><DD>a hash code for the value</DL>
372 <DD>Returns the <code>int</code> value that is equal to <code>value</code>, if possible.
375 <DT><B>Parameters:</B><DD><CODE>value</CODE> - any value in the range of the <code>int</code> type
376 <DT><B>Returns:</B><DD>the <code>int</code> value that equals <code>value</code>
378 <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>value</code> is greater than <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Integer.html?is-external=true#MAX_VALUE" title="class or interface in java.lang"><CODE>Integer.MAX_VALUE</CODE></A> or less than <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Integer.html?is-external=true#MIN_VALUE" title="class or interface in java.lang"><CODE>Integer.MIN_VALUE</CODE></A></DL>
388 <DD>Returns the <code>int</code> nearest in value to <code>value</code>.
391 <DT><B>Parameters:</B><DD><CODE>value</CODE> - any <code>long</code> value
392 <DT><B>Returns:</B><DD>the same value cast to <code>int</code> if it is in the range of the
393 <code>int</code> type, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Integer.html?is-external=true#MAX_VALUE" title="class or interface in java.lang"><CODE>Integer.MAX_VALUE</CODE></A> if it is too large,
394 or <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Integer.html?is-external=true#MIN_VALUE" title="class or interface in java.lang"><CODE>Integer.MIN_VALUE</CODE></A> if it is too small</DL>
405 <DD>Compares the two specified <code>int</code> values. The sign of the value
406 returned is the same as that of <code>((Integer) a).compareTo(b)</code>.
409 <DT><B>Parameters:</B><DD><CODE>a</CODE> - the first <code>int</code> to compare<DD><CODE>b</CODE> - the second <code>int</code> to compare
410 <DT><B>Returns:</B><DD>a negative value if <code>a</code> is less than <code>b</code>; a positive
411 value if <code>a</code> is greater than <code>b</code>; or zero if they are equal</DL>
422 <DD>Returns <code>true</code> if <code>target</code> is present as an element anywhere in
423 <code>array</code>.
426 <DT><B>Parameters:</B><DD><CODE>array</CODE> - an array of <code>int</code> values, possibly empty<DD><CODE>target</CODE> - a primitive <code>int</code> value
427 <DT><B>Returns:</B><DD><code>true</code> if <code>array[i] == target</code> for some value of <code>i</code></DL>
438 <DD>Returns the index of the first appearance of the value <code>target</code> in
439 <code>array</code>.
442 <DT><B>Parameters:</B><DD><CODE>array</CODE> - an array of <code>int</code> values, possibly empty<DD><CODE>target</CODE> - a primitive <code>int</code> value
443 <DT><B>Returns:</B><DD>the least index <code>i</code> for which <code>array[i] == target</code>, or
444 <code>-1</code> if no such index exists.</DL>
455 <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.
457 <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
458 the same elements as <code>target</code>.
461 <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>
472 <DD>Returns the index of the last appearance of the value <code>target</code> in
473 <code>array</code>.
476 <DT><B>Parameters:</B><DD><CODE>array</CODE> - an array of <code>int</code> values, possibly empty<DD><CODE>target</CODE> - a primitive <code>int</code> value
477 <DT><B>Returns:</B><DD>the greatest index <code>i</code> for which <code>array[i] == target</code>,
478 or <code>-1</code> if no such index exists.</DL>
488 <DD>Returns the least value present in <code>array</code>.
491 <DT><B>Parameters:</B><DD><CODE>array</CODE> - a <i>nonempty</i> array of <code>int</code> values
492 <DT><B>Returns:</B><DD>the value present in <code>array</code> that is less than or equal to
495 <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>
505 <DD>Returns the greatest value present in <code>array</code>.
508 <DT><B>Parameters:</B><DD><CODE>array</CODE> - a <i>nonempty</i> array of <code>int</code> values
509 <DT><B>Returns:</B><DD>the value present in <code>array</code> that is greater than or equal to
512 <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>
523 For example, <code>concat(new int[] {a, b}, new int[] {}, new
524 int[] {c}</code> returns the array <code>{a, b, c}</code>.
527 <DT><B>Parameters:</B><DD><CODE>arrays</CODE> - zero or more <code>int</code> arrays
539 <DD>Returns a big-endian representation of <code>value</code> in a 4-element byte
540 array; equivalent to <code>ByteBuffer.allocate(4).putInt(value).array()</code>.
541 For example, the input value <code>0x12131415</code> would yield the byte array
542 <code>{0x12, 0x13, 0x14, 0x15}</code>.
545 different types), use a shared <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio"><CODE>ByteBuffer</CODE></A> instance, or use
546 <A HREF="../../../../com/google/common/io/ByteStreams.html#newDataOutput()"><CODE>ByteStreams.newDataOutput()</CODE></A> to get a growable
562 <DD>Returns the <code>int</code> value whose big-endian representation is stored in
563 the first 4 bytes of <code>bytes</code>; equivalent to <code>ByteBuffer.wrap(bytes).getInt()</code>. For example, the input byte array <code>{0x12, 0x13, 0x14, 0x15, 0x33}</code> would yield the <code>int</code> value <code>0x12131415</code>.
565 <p>Arguably, it's preferable to use <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio"><CODE>ByteBuffer</CODE></A>; that
573 <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>bytes</code> has fewer than 4 elements</DL>
585 <DD>Returns an array containing the same values as <code>array</code>, but
586 guaranteed to be of a specified minimum length. If <code>array</code> already
587 has a length of at least <code>minLength</code>, it is returned directly.
588 Otherwise, a new array of size <code>minLength + padding</code> is returned,
589 containing the values of <code>array</code>, and zeroes in the remaining places.
592 <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
594 <DT><B>Returns:</B><DD>an array containing the values of <code>array</code>, with guaranteed
595 minimum length <code>minLength</code>
597 <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
609 <DD>Returns a string containing the supplied <code>int</code> values separated
610 by <code>separator</code>. For example, <code>join("-", 1, 2, 3)</code> returns
611 the string <code>"1-2-3"</code>.
614 <DT><B>Parameters:</B><DD><CODE>separator</CODE> - the text that should appear between consecutive values in
615 the resulting string (but not at the start or end)<DD><CODE>array</CODE> - an array of <code>int</code> values, possibly empty</DL>
625 <DD>Returns a comparator that compares two <code>int</code> arrays
626 lexicographically. That is, it compares, using <A HREF="../../../../com/google/common/primitives/Ints.html#compare(int, int)"><CODE>compare(int, int)</CODE></A>), the first pair of values that follow any
628 shorter array as the lesser. For example, <code>[] < [1] < [1, 2] < [2]</code>.
630 <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
631 it is consistent with <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Arrays.html?is-external=true#equals(int[], int[])" title="class or interface in java.util"><CODE>Arrays.equals(int[], int[])</CODE></A>.
647 <DD>Copies a collection of <code>Integer</code> instances into a new array of
648 primitive <code>int</code> values.
650 <p>Elements are copied from the argument collection as if by <code>collection.toArray()</code>. Calling this method is as thread-safe as calling
654 <DT><B>Parameters:</B><DD><CODE>collection</CODEcode>Integer</code> objects
655 <DT><B>Returns:</B><DD>an array containing the same values as <code>collection</code>, in the
658 <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
669 <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>,
670 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>.
673 <code>Integer</code> objects written to or read from it. For example, whether
674 <code>list.get(0) == list.get(0)</code> is true for the returned list is
678 <DT><B>Parameters:</B><DD><CODE>backingArray</CODE> - the array to back the list