|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.appserv.management.util.misc.ArrayConversion
public final class ArrayConversion
Provides: - methods to convert arrays of primitive types to corresponding arrays of Object types - conversion to/from Set
Method Summary | ||
---|---|---|
static
|
arrayToSet(T[] names)
|
|
static Object[] |
createObjectArrayType(Class elementType,
int size)
Create an array whose type is elementType[] of specified size. |
|
static boolean |
hasIdenticalElementClasses(Object[] a)
|
|
static Object[] |
setToArray(Set<?> s)
Convert a Set to an Object[]. |
|
static Object[] |
setToArray(Set<?> s,
boolean specialize)
Convert a Set to an array. |
|
static Object[] |
setToArray(Set<?> s,
Object[] out)
Convert a Set to an Object[]. |
|
static Object[] |
specializeArray(Object[] a)
Specialize the type of the array (if possible). |
|
static Object[] |
subArray(Object[] in,
int start,
int end)
|
|
static Object[] |
toAppropriateType(Object array)
Convert an an array of primitive types to an array of Objects of non-primitive types eg int to Integer. |
|
static Boolean[] |
toBooleans(boolean[] array)
|
|
static Byte[] |
toBytes(byte[] array)
|
|
static Character[] |
toCharacters(char[] array)
|
|
static Double[] |
toDoubles(double[] array)
|
|
static Float[] |
toFloats(float[] array)
|
|
static Integer[] |
toIntegers(int[] array)
|
|
static Long[] |
toLongs(long[] array)
|
|
static
|
toSet(T[] array)
|
|
static Short[] |
toShorts(short[] array)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Object[] toAppropriateType(Object array)
array
- the array to convertpublic static Boolean[] toBooleans(boolean[] array)
public static Character[] toCharacters(char[] array)
public static Byte[] toBytes(byte[] array)
public static Short[] toShorts(short[] array)
public static Integer[] toIntegers(int[] array)
public static Long[] toLongs(long[] array)
public static Float[] toFloats(float[] array)
public static Double[] toDoubles(double[] array)
public static Object[] createObjectArrayType(Class elementType, int size)
elementType
- the type of each entry of the arraysize
- the number of elementspublic static Object[] subArray(Object[] in, int start, int end)
public static <T> Set<T> toSet(T[] array)
public static boolean hasIdenticalElementClasses(Object[] a)
public static Object[] specializeArray(Object[] a)
a
- the array to specialize
public static Object[] setToArray(Set<?> s, boolean specialize)
s
- the Set to convertspecialize
- decide whether to specialize the type or notpublic static Object[] setToArray(Set<?> s)
s
- the Set to convertpublic static Object[] setToArray(Set<?> s, Object[] out)
s
- the Set to convertout
- the output array, must be of size s.size()public static <T> Set<T> arrayToSet(T[] names)
|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2006 Sun Microsystems, Inc. All rights reserved.