public void remove() { i.remove(); expectedModCount = l.modCount(); size--; modCount++; }
public void add(E e) { i.add(e); expectedModCount = l.modCount(); size++; modCount++; } };
public void remove() { i.remove(); expectedModCount = l.modCount(); size--; modCount++; }
public void add(E e) { i.add(e); expectedModCount = l.modCount(); size++; modCount++; } };
protected void checkForComodification() { if (l.modCount() != expectedModCount) throw new ConcurrentModificationException(); } }
protected void checkForComodification() { if (l.modCount() != expectedModCount) throw new ConcurrentModificationException(); } }
SubList(ListBase<E> list, int fromIndex, int toIndex) { if (fromIndex < 0) throw new IndexOutOfBoundsException("fromIndex = " + fromIndex); if (toIndex > list.size()) throw new IndexOutOfBoundsException("toIndex = " + toIndex); if (fromIndex > toIndex) throw new IllegalArgumentException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")"); l = list; offset = fromIndex; size = toIndex - fromIndex; expectedModCount = l.modCount(); }
SubList(ListBase<E> list, int fromIndex, int toIndex) { if (fromIndex < 0) throw new IndexOutOfBoundsException("fromIndex = " + fromIndex); if (toIndex > list.size()) throw new IndexOutOfBoundsException("toIndex = " + toIndex); if (fromIndex > toIndex) throw new IllegalArgumentException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")"); l = list; offset = fromIndex; size = toIndex - fromIndex; expectedModCount = l.modCount(); }
public boolean addAll(int index, Collection<? extends E> c) { if (index < 0 || index > size) throw new IndexOutOfBoundsException( "Index: " + index + ", Size: " + size); int cSize = c.size(); if (cSize == 0) return false; checkForComodification(); l.addAll(offset + index, c); expectedModCount = l.modCount(); size += cSize; modCount++; return true; }
public void add(int index, E element) { if (index < 0 || index > size) throw new IndexOutOfBoundsException(); checkForComodification(); l.add(index + offset, element); expectedModCount = l.modCount(); size++; modCount++; }
public boolean addAll(int index, Collection<? extends E> c) { if (index < 0 || index > size) throw new IndexOutOfBoundsException( "Index: " + index + ", Size: " + size); int cSize = c.size(); if (cSize == 0) return false; checkForComodification(); l.addAll(offset + index, c); expectedModCount = l.modCount(); size += cSize; modCount++; return true; }
public void add(int index, E element) { if (index < 0 || index > size) throw new IndexOutOfBoundsException(); checkForComodification(); l.add(index + offset, element); expectedModCount = l.modCount(); size++; modCount++; }
protected void removeRange(int fromIndex, int toIndex) { checkForComodification(); l.removeRange2(fromIndex + offset, toIndex + offset); expectedModCount = l.modCount(); size -= (toIndex - fromIndex); modCount++; }
protected void removeRange(int fromIndex, int toIndex) { checkForComodification(); l.removeRange2(fromIndex + offset, toIndex + offset); expectedModCount = l.modCount(); size -= (toIndex - fromIndex); modCount++; }
public E remove(int index) { rangeCheck(index); checkForComodification(); E result = l.remove(index + offset); expectedModCount = l.modCount(); size--; modCount++; return result; }
public E remove(int index) { rangeCheck(index); checkForComodification(); E result = l.remove(index + offset); expectedModCount = l.modCount(); size--; modCount++; return result; }