Code example for ListIterator

Methods: addprevious

0
        // method call re-enables remove and add 
        if (validForUpdate == false) {
            throw new IllegalStateException("Cannot add to list until next() or previous() called");
        } 
        validForUpdate = false;
        iterator.add(obj);
        iterator.previous();
    } 
 
    /** 
     * Resets the iterator back to the start (which is the 
     * end of the list as this is a reversed iterator) 
     */ 
    public void reset() { 
        iterator = list.listIterator(list.size());
    } 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java