|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.common.collect.PrimitiveArrays
public final class PrimitiveArrays
Static utility methods pertaining to arrays of Java primitives.
| Method Summary | |
|---|---|
static java.util.List<java.lang.Boolean> |
asList(boolean[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static java.util.List<java.lang.Byte> |
asList(byte[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static java.util.List<java.lang.Character> |
asList(char[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static java.util.List<java.lang.Double> |
asList(double[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static java.util.List<java.lang.Float> |
asList(float[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static java.util.List<java.lang.Integer> |
asList(int[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static java.util.List<java.lang.Long> |
asList(long[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static java.util.List<java.lang.Short> |
asList(short[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static boolean[] |
toBooleanArray(java.util.Collection<java.lang.Boolean> collection)
Converts a collection of Boolean instances into a new array of
primitive booleans. |
static byte[] |
toByteArray(java.util.Collection<java.lang.Byte> collection)
Converts a collection of Byte instances into a new array of
primitive bytes. |
static char[] |
toCharArray(java.util.Collection<java.lang.Character> collection)
Converts a collection of Character instances into a new array of
primitive chars. |
static double[] |
toDoubleArray(java.util.Collection<java.lang.Double> collection)
Converts a collection of Double instances into a new array of
primitive doubles. |
static float[] |
toFloatArray(java.util.Collection<java.lang.Float> collection)
Converts a collection of Float instances into a new array of
primitive floats. |
static int[] |
toIntArray(java.util.Collection<java.lang.Integer> collection)
Converts a collection of Integer instances into a new array of
primitive ints. |
static long[] |
toLongArray(java.util.Collection<java.lang.Long> collection)
Converts a collection of Long instances into a new array of
primitive longs. |
static short[] |
toShortArray(java.util.Collection<java.lang.Short> collection)
Converts a collection of Short instances into a new array of
primitive shorts. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static short[] toShortArray(java.util.Collection<java.lang.Short> collection)
Short instances into a new array of
primitive shorts.
collection - a collection of Short objects
collection, in the
same order, converted to primitives
java.lang.NullPointerException - if collection or any of its elements
are nullpublic static java.util.List<java.lang.Short> asList(short[] backingArray)
Arrays.asList(T...). The only additional restriction of the returned list is
that null cannot be assigned to any element via List.set(int,Object) or ListIterator.set(E).
backingArray - the array to back the list
public static int[] toIntArray(java.util.Collection<java.lang.Integer> collection)
Integer instances into a new array of
primitive ints.
collection - a collection of Integer objects
collection, in the
same order, converted to primitives
java.lang.NullPointerException - if collection or any of its elements
are nullpublic static java.util.List<java.lang.Integer> asList(int[] backingArray)
Arrays.asList(T...). The only additional restriction of the returned list is
that null cannot be assigned to any element via List.set(int,Object) or ListIterator.set(E).
backingArray - the array to back the list
public static double[] toDoubleArray(java.util.Collection<java.lang.Double> collection)
Double instances into a new array of
primitive doubles.
collection - a collection of Double objects
collection, in the
same order, converted to primitives
java.lang.NullPointerException - if collection or any of its elements
are nullpublic static java.util.List<java.lang.Double> asList(double[] backingArray)
Arrays.asList(T...). The only additional restriction of the returned list is
that null cannot be assigned to any element via List.set(int,Object) or ListIterator.set(E).
backingArray - the array to back the list
public static float[] toFloatArray(java.util.Collection<java.lang.Float> collection)
Float instances into a new array of
primitive floats.
collection - a collection of float objects
collection, in the
same order, converted to primitives
java.lang.NullPointerException - if collection or any of its elements
are nullpublic static java.util.List<java.lang.Float> asList(float[] backingArray)
Arrays.asList(T...). The only additional restriction of the returned list is
that null cannot be assigned to any element via List.set(int,Object) or ListIterator.set(E).
backingArray - the array to back the list
public static long[] toLongArray(java.util.Collection<java.lang.Long> collection)
Long instances into a new array of
primitive longs.
collection - a collection of Long objects
collection, in the
same order, converted to primitives
java.lang.NullPointerException - if collection or any of its elements
are nullpublic static java.util.List<java.lang.Long> asList(long[] backingArray)
Arrays.asList(T...). The only additional restriction of the returned list is
that null cannot be assigned to any element via List.set(int,Object) or ListIterator.set(E).
backingArray - the array to back the list
public static char[] toCharArray(java.util.Collection<java.lang.Character> collection)
Character instances into a new array of
primitive chars.
collection - a collection of Character objects
collection, in the
same order, converted to primitives
java.lang.NullPointerException - if collection or any of its elements
are nullpublic static java.util.List<java.lang.Character> asList(char[] backingArray)
Arrays.asList(T...). The only additional restriction of the returned list is
that null cannot be assigned to any element via List.set(int,Object) or ListIterator.set(E).
backingArray - the array to back the list
public static boolean[] toBooleanArray(java.util.Collection<java.lang.Boolean> collection)
Boolean instances into a new array of
primitive booleans.
collection - a collection of Booleans objects
collection, in the
same order, converted to primitives
java.lang.NullPointerException - if collection or any of its elements
are nullpublic static java.util.List<java.lang.Boolean> asList(boolean[] backingArray)
Arrays.asList(T...). The only additional restriction of the returned list is
that null cannot be assigned to any element via List.set(int,Object) or ListIterator.set(E).
backingArray - the array to back the list
public static byte[] toByteArray(java.util.Collection<java.lang.Byte> collection)
Byte instances into a new array of
primitive bytes.
collection - a collection of Byte objects
collection, in the
same order, converted to primitives
java.lang.NullPointerException - if collection or any of its elements
are nullpublic static java.util.List<java.lang.Byte> asList(byte[] backingArray)
Arrays.asList(T...). The only additional restriction of the returned list is
that null cannot be assigned to any element via List.set(int,Object) or ListIterator.set(E).
backingArray - the array to back the list
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||