|
|||||||||
| 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 List<Boolean> |
asList(boolean[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static List<Byte> |
asList(byte[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static List<Character> |
asList(char[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static List<Double> |
asList(double[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static List<Float> |
asList(float[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static List<Integer> |
asList(int[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static List<Long> |
asList(long[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static List<Short> |
asList(short[] backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays.asList(T...). |
static boolean[] |
toBooleanArray(Collection<Boolean> collection)
Converts a Collection of Boolean instances (wrapper objects) into a
new array of primitive booleans. |
static byte[] |
toByteArray(Collection<Byte> collection)
Converts a Collection of Byte instances (wrapper objects) into a
new array of primitive bytes. |
static char[] |
toCharArray(Collection<Character> collection)
Converts a Collection of Character instances (wrapper objects) into
a new array of primitive chars. |
static double[] |
toDoubleArray(Collection<Double> collection)
Converts a Collection of Double instances (wrapper objects) into a
new array of primitive doubles. |
static float[] |
toFloatArray(Collection<Float> collection)
Converts a Collection of Float instances (wrapper objects) into a
new array of primitive floats. |
static int[] |
toIntArray(Collection<Integer> collection)
Converts a Collection of Integer instances (wrapper objects) into a
new array of primitive ints. |
static long[] |
toLongArray(Collection<Long> collection)
Converts a Collection of Long instances (wrapper objects) into a
new array of primitive longs. |
static short[] |
toShortArray(Collection<Short> collection)
Converts a Collection of Short instances (wrapper objects) 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(Collection<Short> collection)
Short instances (wrapper objects) into a
new array of primitive shorts.
collection - a Collection of Shorts.
collection, in the
same order, converted to primitives.public static List<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).
backingArray - the array to back the list
public static int[] toIntArray(Collection<Integer> collection)
Integer instances (wrapper objects) into a
new array of primitive ints.
collection - a Collection of Integers.
collection, in the
same order, converted to primitives.public static List<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).
backingArray - the array to back the list
public static double[] toDoubleArray(Collection<Double> collection)
Double instances (wrapper objects) into a
new array of primitive doubles.
collection - a Collection of Doubles.
collection, in the
same order, converted to primitives.public static List<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).
backingArray - the array to back the list
public static float[] toFloatArray(Collection<Float> collection)
Float instances (wrapper objects) into a
new array of primitive floats.
collection - a Collection of Floats.
collection, in the
same order, converted to primitives.public static List<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).
backingArray - the array to back the list
public static long[] toLongArray(Collection<Long> collection)
Long instances (wrapper objects) into a
new array of primitive longs.
collection - a Collection of Longs.
collection, in the
same order, converted to primitives.public static List<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).
backingArray - the array to back the list
public static char[] toCharArray(Collection<Character> collection)
Character instances (wrapper objects) into
a new array of primitive chars.
collection - a Collection of Characters.
collection, in the
same order, converted to primitives.public static List<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).
backingArray - the array to back the list
public static boolean[] toBooleanArray(Collection<Boolean> collection)
Boolean instances (wrapper objects) into a
new array of primitive booleans.
collection - a Collection of Booleans.
collection, in the
same order, converted to primitives.public static List<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).
backingArray - the array to back the list
public static byte[] toByteArray(Collection<Byte> collection)
Byte instances (wrapper objects) into a
new array of primitive bytes.
collection - a Collection of Bytes.
collection, in the
same order, converted to primitives.public static List<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).
backingArray - the array to back the list
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||