int primitives, that are not already found in either
Integer or Arrays.
See the Guava User Guide article on primitive utilities.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | BYTES
The number of bytes required to represent a primitive |
| public static final int | MAX_POWER_OF_TWO
The largest power of two that can be represented as an |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static List | Returns: a list view of the arraythe array to back the list backingArray)Returns a fixed-size list backed by the specified array, similar to |
| public static int | Returns: theint value that equals valueany value in the range of the value)int typeReturns the |
| public static int | Returns: a negative value ifa is less than b; a positive value if a is
greater than b; or zero if they are equalthe first a, int int to comparethe second b)int to compareCompares the two specified |
| public static int[] | Returns: a single array containing all the values from the source arrays, in orderzero or more arrays)int arraysReturns the values from each provided array combined into a single array. |
| public static int | constrainToRange(int
the value, int int value to constrainthe lower bound (inclusive) of the range to constrain min, int value tothe upper bound (inclusive) of the range to constrain max)value toReturns the value nearest to |
| public static boolean | Returns: true if array[i] == target for some value of ian array of array, int int values, possibly emptya primitive target)int valueReturns |
| public static int[] | Returns: an array containing the values ofarray, with guaranteed minimum length minLengththe source array array, int the minimum length the returned array must guarantee minLength, int an extra amount to "grow" the array by if growth is necessary padding)Returns an array containing the same values as |
| public static int | fromByteArray(byte[] bytes)
Returns the |
| public static int | fromBytes(byte b1, byte b2, byte b3, byte b4)
Returns the |
| public static int | Returns: a hash code for the valuea primitive value)int valueReturns a hash code for |
| public static int | Returns: the least indexi for which array[i] == target, or -1 if no
such index exists.an array of array, int int values, possibly emptya primitive target)int valueReturns the index of the first appearance of the value |
| private static int | |
| public static int | indexOf(int[]
the array to search for the sequence array, int[] targetthe array to search for as a sub-sequence of target)arrayReturns the start position of the first occurrence of the specified |
| public static String | |
| public static int | Returns: the greatest indexi for which array[i] == target, or -1 if no
such index exists.an array of array, int int values, possibly emptya primitive target)int valueReturns the index of the last appearance of the value |
| private static int | |
| public static Comparator | |
| public static int | Returns: the value present inarray that is greater than or equal to every other value
in the arraya nonempty array of array)int valuesReturns the greatest value present in |
| public static int | Returns: the value present inarray that is less than or equal to every other value in
the arraya nonempty array of array)int valuesReturns the least value present in |
| public static void | |
| public static void | reverse(int[] array, int fromIndex, int toIndex)
Reverses the elements of |
| public static void | rotate(int[] array, int distance)
Performs a right rotation of |
| public static void | rotate(int[] array, int distance, int fromIndex, int toIndex)
Performs a right rotation of |
| public static int | Returns: the same value cast toint if it is in the range of the int type,
Integer#MAX_VALUE if it is too large, or Integer#MIN_VALUE if it is too
smallany value)long valueReturns the |
| public static void | |
| public static void | sortDescending(int[] array, int fromIndex, int toIndex)
Sorts the elements of |
| public static Converter | stringConverter()
Returns a serializable converter object that converts between strings and integers using |
| public static int[] | Returns: an array containing the same values ascollection, in the same order, converted
to primitivesa collection of collection)Number instancesReturns an array containing each value of |
| public static byte[] | toByteArray(int value)
Returns a big-endian representation of |
| public static Integer | |
| public static Integer | Returns: the integer value represented bystring using radix, or null if
string has a length of zero or cannot be parsed as an integer valuethe string representation of an integer value string, int the radix to use when parsing radix)Parses the specified string as a signed integer value using the specified radix. |