Code example for ListIterator

Methods: hasPreviouspreviousIndex

    public int previousIndex() { 
        if (list.isEmpty()) {
            throw new NoSuchElementException(
                "There are no elements for this iterator to loop on"); 
        if (iterator.hasPrevious() == false) {
            return list.size() - 1;
        } else { 
            return iterator.previousIndex();
     * Removes the previously retrieved item from the underlying list. 
     * <p> 
     * This feature is only supported if the underlying list's 
     * {@link List#iterator iterator} method returns an implementation 
     * that supports it. 
     * <p> 
     * This method can only be called after at least one {@link #next} 
Connect your IDE to all the code out there  Get Codota for Java