コード例 #1
0
ファイル: AbstractList.java プロジェクト: sherckuith/jop
 protected void removeRange(int fromIndex, int toIndex) {
   checkForComodification();
   l.removeRange(fromIndex + offset, toIndex + offset);
   expectedModCount = l.modCount;
   size -= (toIndex - fromIndex);
   modCount++;
 }
コード例 #2
0
ファイル: AbstractList.java プロジェクト: sherckuith/jop
 /**
  * Removes all of the elements from this list (optional operation). The list will be empty after
  * this call returns.
  *
  * <p>This implementation calls {@code removeRange(0, size())}.
  *
  * <p>Note that this implementation throws an {@code UnsupportedOperationException} unless {@code
  * remove(int index)} or {@code removeRange(int fromIndex, int toIndex)} is overridden.
  *
  * @throws UnsupportedOperationException if the {@code clear} operation is not supported by this
  *     list
  */
 public void clear() {
   removeRange(0, size());
 }