Lines Matching full:code
104 Static utility methods pertaining to <code>long</code> primitives, that are not
105 already found in either <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang"><CODE>Long</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/Longs.html#BYTES">BYTES</A></B></CODE>
132 The number of bytes required to represent a primitive <code>long</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/Long.html?is-external=true" title="class or interface in java.lang">Long</A>></CODE></FONT></TD>
148 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Longs.html#asList(long...)">asList</A></B>(long... 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/Longs.html#compare(long, long)">compare</A></B>(long a,
157 long b)</CODE>
160 Compares the two specified <code>long</code> values.</TD>
164 <CODE>static long[]</CODE></FONT></TD>
165 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Longs.html#concat(long[]...)">concat</A></B>(long[]... arrays)</CODE>
172 <CODE>static boolean</CODE></FONT></TD>
173 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Longs.html#contains(long[], long)">contains</A></B>(long[] array,
174 long target)</CODE>
177 Returns <code>true</code> if <code>target</code> is present as an element anywhere in
178 <code>array</code>.</TD>
182 <CODE>static long[]</CODE></FONT></TD>
183 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Longs.html#ensureCapacity(long[], int, int)">ensureCapacity</A></B>(long[] array,
185 int padding)</CODE>
188 Returns an array containing the same values as <code>array</code>, but
193 <CODE>static long</CODE></FONT></TD>
194 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Longs.html#fromByteArray(byte[])">fromByteArray</A></B>(byte[] bytes)</CODE>
197 Returns the <code>long</code> value whose big-endian representation is
198 stored in the first 8 bytes of <code>bytes</code>; equivalent to <code>ByteBuffer.wrap(bytes).getLong()</code>.</TD>
202 <CODE>static int</CODE></FONT></TD>
203 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Longs.html#hashCode(long)">hashCode</A></B>(long value)</CODE>
206 Returns a hash code for <code>value</code>; equal to the result of invoking
207 <code>((Long) value).hashCode()</code>.</TD>
211 <CODE>static int</CODE></FONT></TD>
212 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Longs.html#indexOf(long[], long)">indexOf</A></B>(long[] array,
213 long target)</CODE>
216 Returns the index of the first appearance of the value <code>target</code> in
217 <code>array</code>.</TD>
221 <CODE>static int</CODE></FONT></TD>
222 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Longs.html#indexOf(long[], long[])">indexOf</A></B>(long[] array,
223 long[] target)</CODE>
226 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>
230 <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>
231 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Longs.html#join(java.lang.String, long...)">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,
232 long... array)</CODE>
235 Returns a string containing the supplied <code>long</code> values separated
236 by <code>separator</code>.</TD>
240 <CODE>static int</CODE></FONT></TD>
241 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Longs.html#lastIndexOf(long[], long)">lastIndexOf</A></B>(long[] array,
242 long target)</CODE>
245 Returns the index of the last appearance of the value <code>target</code> in
246 <code>array</code>.</TD>
250 <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><long[]></CODE></FONT></TD>
251 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Longs.html#lexicographicalComparator()">lexicographicalComparator</A></B>()</CODE>
254 Returns a comparator that compares two <code>long</code> arrays
259 <CODE>static long</CODE></FONT></TD>
260 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Longs.html#max(long...)">max</A></B>(long... array)</CODE>
263 Returns the greatest value present in <code>array</code>.</TD>
267 <CODE>static long</CODE></FONT></TD>
268 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Longs.html#min(long...)">min</A></B>(long... array)</CODE>
271 Returns the least value present in <code>array</code>.</TD>
275 <CODE>static long[]</CODE></FONT></TD>
276 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Longs.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/Long.html?is-external=true" title="class or interface in java.lang">Long</A>> collection)</CODE>
279 Copies a collection of <code>Long</code> instances into a new array of
280 primitive <code>long</code> values.</TD>
284 <CODE>static byte[]</CODE></FONT></TD>
285 <TD><CODE><B><A HREF="../../../../com/google/common/primitives/Longs.html#toByteArray(long)">toByteArray</A></B>(long value)</CODE>
288 Returns a big-endian representation of <code>value</code> in an 8-element byte
289 array; equivalent to <code>ByteBuffer.allocate(8).putLong(value).array()</code>.</TD>
298 <TD><CODECODE></TD>
319 <DD>The number of bytes required to represent a primitive <code>long</code>
341 <DD>Returns a hash code for <code>value</code>; equal to the result of invoking
342 <code>((Long) value).hashCode()</code>.
345 <DT><B>Parameters:</B><DD><CODE>value</CODE> - a primitive <code>long</code> value
346 <DT><B>Returns:</B><DD>a hash code for the value</DL>
357 <DD>Compares the two specified <code>long</code> values. The sign of the value
358 returned is the same as that of <code>((Long) a).compareTo(b)</code>.
361 <DT><B>Parameters:</B><DD><CODE>a</CODE> - the first <code>long</code> to compare<DD><CODE>b</CODE> - the second <code>long</code> to compare
362 <DT><B>Returns:</B><DD>a negative value if <code>a</code> is less than <code>b</code>; a positive
363 value if <code>a</code> is greater than <code>b</code>; or zero if they are equal</DL>
374 <DD>Returns <code>true</code> if <code>target</code> is present as an element anywhere in
375 <code>array</code>.
378 <DT><B>Parameters:</B><DD><CODE>array</CODE> - an array of <code>long</code> values, possibly empty<DD><CODE>target</CODE> - a primitive <code>long</code> value
379 <DT><B>Returns:</B><DD><code>true</code> if <code>array[i] == target</code> for some value of <code>i</code></DL>
390 <DD>Returns the index of the first appearance of the value <code>target</code> in
391 <code>array</code>.
394 <DT><B>Parameters:</B><DD><CODE>array</CODE> - an array of <code>long</code> values, possibly empty<DD><CODE>target</CODE> - a primitive <code>long</code> value
395 <DT><B>Returns:</B><DD>the least index <code>i</code> for which <code>array[i] == target</code>, or
396 <code>-1</code> if no such index exists.</DL>
407 <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.
409 <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
410 the same elements as <code>target</code>.
413 <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>
424 <DD>Returns the index of the last appearance of the value <code>target</code> in
425 <code>array</code>.
428 <DT><B>Parameters:</B><DD><CODE>array</CODE> - an array of <code>long</code> values, possibly empty<DD><CODE>target</CODE> - a primitive <code>long</code> value
429 <DT><B>Returns:</B><DD>the greatest index <code>i</code> for which <code>array[i] == target</code>,
430 or <code>-1</code> if no such index exists.</DL>
440 <DD>Returns the least value present in <code>array</code>.
443 <DT><B>Parameters:</B><DD><CODE>array</CODE> - a <i>nonempty</i> array of <code>long</code> values
444 <DT><B>Returns:</B><DD>the value present in <code>array</code> that is less than or equal to
447 <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>
457 <DD>Returns the greatest value present in <code>array</code>.
460 <DT><B>Parameters:</B><DD><CODE>array</CODE> - a <i>nonempty</i> array of <code>long</code> values
461 <DT><B>Returns:</B><DD>the value present in <code>array</code> that is greater than or equal to
464 <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>
475 For example, <code>concat(new long[] {a, b}, new long[] {}, new
476 long[] {c}</code> returns the array <code>{a, b, c}</code>.
479 <DT><B>Parameters:</B><DD><CODE>arrays</CODE> - zero or more <code>long</code> arrays
491 <DD>Returns a big-endian representation of <code>value</code> in an 8-element byte
492 array; equivalent to <code>ByteBuffer.allocate(8).putLong(value).array()</code>.
493 For example, the input value <code>0x1213141516171819L</code> would yield the
494 byte array <code>{0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19}</code>.
497 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
498 <A HREF="../../../../com/google/common/io/ByteStreams.html#newDataOutput()"><CODE>ByteStreams.newDataOutput()</CODE></A> to get a growable
514 <DD>Returns the <code>long</code> value whose big-endian representation is
515 stored in the first 8 bytes of <code>bytes</code>; equivalent to <code>ByteBuffer.wrap(bytes).getLong()</code>. For example, the input byte array
516 <code>{0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19}</code> would yield the
517 <code>long</code> value <code>0x1213141516171819L</code>.
519 <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
527 <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 8
540 <DD>Returns an array containing the same values as <code>array</code>, but
541 guaranteed to be of a specified minimum length. If <code>array</code> already
542 has a length of at least <code>minLength</code>, it is returned directly.
543 Otherwise, a new array of size <code>minLength + padding</code> is returned,
544 containing the values of <code>array</code>, and zeroes in the remaining places.
547 <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
549 <DT><B>Returns:</B><DD>an array containing the values of <code>array</code>, with guaranteed
550 minimum length <code>minLength</code>
552 <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
564 <DD>Returns a string containing the supplied <code>long</code> values separated
565 by <code>separator</code>. For example, <code>join("-", 1L, 2L, 3L)</code> returns
566 the string <code>"1-2-3"</code>.
569 <DT><B>Parameters:</B><DD><CODE>separator</CODE> - the text that should appear between consecutive values in
570 the resulting string (but not at the start or end)<DD><CODE>array</CODE> - an array of <code>long</code> values, possibly empty</DL>
580 <DD>Returns a comparator that compares two <code>long</code> arrays
581 lexicographically. That is, it compares, using <A HREF="../../../../com/google/common/primitives/Longs.html#compare(long, long)"><CODE>compare(long, long)</CODE></A>), the first pair of values that follow any
584 <code>[] < [1L] < [1L, 2L] < [2L]</code>.
586 <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
587 it is consistent with <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Arrays.html?is-external=true#equals(long[], long[])" title="class or interface in java.util"><CODE>Arrays.equals(long[], long[])</CODE></A>.
603 <DD>Copies a collection of <code>Long</code> instances into a new array of
604 primitive <code>long</code> values.
606 <p>Elements are copied from the argument collection as if by <code>collection.toArray()</code>. Calling this method is as thread-safe as calling
610 <DT><B>Parameters:</B><DD><CODE>collection</CODE> - a collection of <code>Long</code> objects
611 <DT><B>Returns:</B><DD>an array containing the same values as <code>collection</code>, in the
614 <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
625 <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>,
626 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>.
629 <code>Long</code> objects written to or read from it. For example, whether
630 <code>list.get(0) == list.get(0)</code> is true for the returned list is
634 <DT><B>Parameters:</B><DD><CODE>backingArray</CODE> - the array to back the list