Lines Matching refs:collection
412 * Copies a collection of {@code Character} instances into a new array of
415 * <p>Elements are copied from the argument collection as if by {@code
416 * collection.toArray()}. Calling this method is as thread-safe as calling
419 * @param collection a collection of {@code Character} objects
420 * @return an array containing the same values as {@code collection}, in the
422 * @throws NullPointerException if {@code collection} or any of its elements
425 public static char[] toArray(Collection<Character> collection) {
426 if (collection instanceof CharArrayAsList) {
427 return ((CharArrayAsList) collection).toCharArray();
430 Object[] boxedArray = collection.toArray();