Logo Search packages:      
Sourcecode: libjgoodies-binding-java version File versions

void com::jgoodies::binding::list::LinkedListModel::ReportingListIterator::add ( Object  o  )  [inline]

Inserts the specified element into the list (optional operation). The element is inserted immediately before the next element that would be returned by next, if any, and after the next element that would be returned by previous, if any. (If the list contains no elements, the new element becomes the sole element on the list.) The new element is inserted before the implicit cursor: a subsequent call to next would be unaffected, and a subsequent call to previous would return the new element. (This call increases by one the value that would be returned by a call to nextIndex or previousIndex.)

Parameters:
o the element to insert.
Exceptions:
UnsupportedOperationException if the add method is not supported by this list iterator.
ClassCastException if the class of the specified element prevents it from being added to this list.
IllegalArgumentException if some aspect of this element prevents it from being added to this list.

Definition at line 677 of file LinkedListModel.java.

References delegate, lastReturnedIndex, and previousIndex().

                                  {
            delegate.add(o);
            int newIndex = previousIndex();
            LinkedListModel.this.fireIntervalAdded(newIndex, newIndex);
            lastReturnedIndex = -1;
        }


Generated by  Doxygen 1.6.0   Back to index