Searches this list for the specified object and returns the index of the last occurrence. @param object the object to search for. @return the index of the last occurrence of the object, or -1 if the object was not found.
(Object object)
| 578 | * object was not found. |
| 579 | */ |
| 580 | public int lastIndexOf(Object object) { |
| 581 | ListIterator<?> it = listIterator(size()); |
| 582 | if (object != null) { |
| 583 | while (it.hasPrevious()) { |
| 584 | if (object.equals(it.previous())) { |
| 585 | return it.nextIndex(); |
| 586 | } |
| 587 | } |
| 588 | } else { |
| 589 | while (it.hasPrevious()) { |
| 590 | if (it.previous() == null) { |
| 591 | return it.nextIndex(); |
| 592 | } |
| 593 | } |
| 594 | } |
| 595 | return -1; |
| 596 | } |
| 597 | |
| 598 | /** |
| 599 | * Returns a ListIterator on the elements of this list. The elements are |
nothing calls this directly
no test coverage detected