add3 method

bool add3(
  1. List<Coordinate> coord,
  2. bool allowRepeated,
  3. bool direction
)

Adds an array of coordinates to the list. @param coord The coordinates @param allowRepeated if set to false, repeated coordinates are collapsed @param direction if false, the array is added in reverse order @return true (as by general collection contract)

Implementation

bool add3(List<Coordinate> coord, bool allowRepeated, bool direction) {
  if (direction) {
    for (int i = 0; i < coord.length; i++) {
      addCoord(coord[i], allowRepeated);
    }
  } else {
    for (int i = coord.length - 1; i >= 0; i--) {
      addCoord(coord[i], allowRepeated);
    }
  }
  return true;
}