indexOf static method
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;
}