List of utility methods to do Collection to Array
String[] | toArray(Collection to Array if (strings.isEmpty()) { return EMPTY_STRING_ARRAY; return strings.toArray(new String[strings.size()]); |
String[] | toArray(Collection to Array return values.toArray(EMPTY_ARRAY);
|
T[] | toArray(Collection This is a replacement for Collection#toArray(Object[]) . final int size = c.size(); if (size == sample.length && size < ARRAY_COPY_THRESHOLD) { int i = 0; for (T t : c) { sample[i++] = t; return sample; return c.toArray(sample); |
T[] | toArray(Collection Cast a collection to an array return (T[]) collection.toArray(new Object[collection.size()]); |
T[] | toArray(Collection Convenience method for List#toArray(Object[]) to pass compiler warnings for generic typed array. Object[] array = list.toArray(type);
return (T[]) array;
|
Object[] | toArray(final Collection> c) to Array return c == null ? null : c.toArray();
|
byte[] | toArray(final Collection to Array if (array.length < coll.size()) { array = new byte[coll.size()]; final Iterator<Byte> it = coll.iterator(); int i = 0; while (it.hasNext()) { array[i++] = it.next().byteValue(); return array; |
int[] | toArray(final Collection to Array if (collection == null || collection.isEmpty()) { return new int[0]; final int[] result = new int[collection.size()]; int index = 0; for (final Integer integer : collection) { result[index] = integer.intValue(); index++; ... |
String[] | toArray(final Collection to Array if (collection == null) return null; final String[] a = new String[collection.size()]; collection.toArray(a); return a; |
String[] | toArray(java.util.Collection to Array String[] array = new String[collection.size()]; Iterator<String> i = collection.iterator(); int index = 0; while (i.hasNext()) { array[index] = i.next(); index++; return array; ... |