/** * Removes the supplied element from the list, forcing a notification to the listeners * regardless of whether the element was in the list or not. * @return true if the element was in the list and was removed, false if it was not. */ public boolean removeForce (E elem) { checkMutate(); int index = _impl.indexOf(elem); if (index >= 0) _impl.remove(index); emitRemove(index, elem); return (index >= 0); }
public void set (E elem) { checkMutate(); iiter.set(elem); emitSet(iiter.previousIndex(), elem, _current); _current = elem; } protected E _current; // the element targeted by remove or set
@Override public E set (int index, E element) { checkMutate(); E removed = _impl.set(index, element); emitSet(index, element, removed); return removed; }
@Override public boolean addAll (int index, Collection<? extends E> elements) { checkMutate(); // Call add instead of calling _impl.addAll so if a listener throws an exception on // emission, we don't have elements added without a corresponding emission for (E elem : elements) { add(index++, elem); } return true; }
public void remove () { checkMutate(); int index = iiter.previousIndex(); iiter.remove(); emitRemove(index, _current); } public void set (E elem) {
@Override public E remove (int index) { checkMutate(); E removed = _impl.remove(index); emitRemove(index, removed); return removed; }
public void add (E elem) { checkMutate(); int index = iiter.nextIndex(); iiter.add(elem); emitAdd(index, elem); } public boolean hasNext () {
@Override public E set (int index, E element) { checkMutate(); E removed = _impl.set(index, element); emitSet(index, element, removed); return removed; }
@Override public boolean addAll (int index, Collection<? extends E> elements) { checkMutate(); // Call add instead of calling _impl.addAll so if a listener throws an exception on // emission, we don't have elements added without a corresponding emission for (E elem : elements) { add(index++, elem); } return true; }
public void set (E elem) { checkMutate(); iiter.set(elem); emitSet(iiter.previousIndex(), elem, _current); _current = elem; } protected E _current; // the element targeted by remove or set
@Override public boolean remove (Object object) { checkMutate(); int index = _impl.indexOf(object); if (index < 0) return false; _impl.remove(index); // the cast is safe if the element was removed @SuppressWarnings("unchecked") E elem = (E)object; emitRemove(index, elem); return true; }
/** * Removes the supplied element from the list, forcing a notification to the listeners * regardless of whether the element was in the list or not. * @return true if the element was in the list and was removed, false if it was not. */ public boolean removeForce (E elem) { checkMutate(); int index = _impl.indexOf(elem); if (index >= 0) _impl.remove(index); emitRemove(index, elem); return (index >= 0); }
@Override public void add (int index, E element) { checkMutate(); _impl.add(index, element); emitAdd(index, element); }
@Override public void add (int index, E element) { checkMutate(); _impl.add(index, element); emitAdd(index, element); }
public void add (E elem) { checkMutate(); int index = iiter.nextIndex(); iiter.add(elem); emitAdd(index, elem); } public boolean hasNext () {
@Override public boolean remove (Object object) { checkMutate(); int index = _impl.indexOf(object); if (index < 0) return false; _impl.remove(index); // the cast is safe if the element was removed @SuppressWarnings("unchecked") E elem = (E)object; emitRemove(index, elem); return true; }
public void remove () { checkMutate(); int index = iiter.previousIndex(); iiter.remove(); emitRemove(index, _current); } public void set (E elem) {
@Override public E remove (int index) { checkMutate(); E removed = _impl.remove(index); emitRemove(index, removed); return removed; }