Searches this list for the specified object and returns the index of the first occurrence. @param object the object to search for. @return the index of the first occurrence of the object, or -1 if it was not found.
(Object object)
| 539 | * not found. |
| 540 | */ |
| 541 | public int indexOf(Object object) { |
| 542 | ListIterator<?> it = listIterator(); |
| 543 | if (object != null) { |
| 544 | while (it.hasNext()) { |
| 545 | if (object.equals(it.next())) { |
| 546 | return it.previousIndex(); |
| 547 | } |
| 548 | } |
| 549 | } else { |
| 550 | while (it.hasNext()) { |
| 551 | if (it.next() == null) { |
| 552 | return it.previousIndex(); |
| 553 | } |
| 554 | } |
| 555 | } |
| 556 | return -1; |
| 557 | } |
| 558 | |
| 559 | /** |
| 560 | * Returns an iterator on the elements of this list. The elements are |
nothing calls this directly
no test coverage detected