copyDeepWithLength static method

void copyDeepWithLength(
  1. List<Coordinate> src,
  2. int srcStart,
  3. List<Coordinate> dest,
  4. int destStart,
  5. int length,
)

Creates a deep copy of a given section of a source {@link Coordinate} array into a destination Coordinate array. The destination array must be an appropriate size to receive the copied coordinates.

@param src an array of Coordinates @param srcStart the index to start copying from @param dest the @param destStart the destination index to start copying to @param length the number of items to copy

Implementation

static void copyDeepWithLength(List<Coordinate> src, int srcStart,
    List<Coordinate> dest, int destStart, int length) {
  for (int i = 0; i < length; i++) {
    dest[destStart + i] = src[srcStart + i].copy();
  }
}