indexOf static method

int indexOf(
  1. Coordinate coordinate,
  2. List<Coordinate> coordinates
)

Returns the index of coordinate in coordinates. The first position is 0; the second, 1; etc.

@param coordinate the Coordinate to search for @param coordinates the array to search @return the position of coordinate, or -1 if it is not found

Implementation

static int indexOf(Coordinate coordinate, List<Coordinate> coordinates) {
  for (int i = 0; i < coordinates.length; i++) {
    if (coordinate == coordinates[i]) {
      return i;
    }
  }
  return -1;
}