Lines Matching refs:collection
365 * Copies a collection of {@code Short} instances into a new array of
368 * <p>Elements are copied from the argument collection as if by {@code
369 * collection.toArray()}. Calling this method is as thread-safe as calling
372 * @param collection a collection of {@code Short} objects
373 * @return an array containing the same values as {@code collection}, in the
375 * @throws NullPointerException if {@code collection} or any of its elements
378 public static short[] toArray(Collection<Short> collection) {
379 if (collection instanceof ShortArrayAsList) {
380 return ((ShortArrayAsList) collection).toShortArray();
383 Object[] boxedArray = collection.toArray();