fun add(i: Int, coord: Coordinate?, allowRepeated: Boolean) { if (!allowRepeated) { val size: Int = size() if (size > 0) { if (i > 0) { val prev: Coordinate = get(i - 1) as Coordinate if (prev.equals2D(coord)) return } if (i < size) { val next: Coordinate = get(i) as Coordinate if (next.equals2D(coord)) return } } } super.add(i, coord) }
Inserts the specified coordinate at the specified position in this list .