INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. @param option the option to search for @return the index of the provided option or zero if not found
(final HtmlOption option)
| 708 | * @return the index of the provided option or zero if not found |
| 709 | */ |
| 710 | public int indexOf(final HtmlOption option) { |
| 711 | if (option == null) { |
| 712 | return 0; |
| 713 | } |
| 714 | |
| 715 | int index = 0; |
| 716 | for (final HtmlElement element : getHtmlElementDescendants()) { |
| 717 | if (option == element) { |
| 718 | return index; |
| 719 | } |
| 720 | index++; |
| 721 | } |
| 722 | return 0; |
| 723 | } |
| 724 | |
| 725 | /** |
| 726 | * {@inheritDoc} |
no test coverage detected