Here you can find the source of copyRemainder(final T[] sourceArray, final int startIndex, final Collection
Parameter | Description |
---|---|
sourceArray | is the source array to copy from |
startIndex | is an index in the array from which the copying shall start |
collector | collects the copied elements |
private static <T> void copyRemainder(final T[] sourceArray, final int startIndex, final Collection<T> collector)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { /**//from w w w . j a v a 2 s . c o m * Adds all elements of the given array to the collector, starting from the given index. * * @param sourceArray * is the source array to copy from * @param startIndex * is an index in the array from which the copying shall start * @param collector * collects the copied elements */ private static <T> void copyRemainder(final T[] sourceArray, final int startIndex, final Collection<T> collector) { for (int index = startIndex; index < sourceArray.length; index++) { collector.add(sourceArray[index]); } } }