copy static method
Copy a list (src
) to another (dst
)
Implementation
static List copy(List src, int srcStart,
List dst, int dstStart, int count) {
if (srcStart < dstStart) {
for (int i = srcStart + count - 1, j = dstStart + count - 1;
i >= srcStart; i--, j--) {
dst[j] = src[i];
}
} else {
for (int i = srcStart, j = dstStart; i < srcStart + count; i++, j++) {
dst[j] = src[i];
}
}
return dst;
}