Code example for ListIterator

Methods: previousIndexset

0
        ownerSCO.remove(iter.nextIndex());
    } 
 
    public void set(Object o)
    { 
        iter.set(o);
 
        /* 
         * (java.util.ListIterator API docs) 
         * "Note that the remove() and set(Object) methods are not defined in terms of the cursor position; 
         * they are defined to operate on the last element returned by a call to next() or previous()." 
         */ 
        ownerSCO.set(reverse ? iter.nextIndex() : iter.previousIndex(), o);
    } 
} 
Experience pair programming with AI  Get Codota for Java