388 |
|
* @return <tt>true</tt> (as specified by {@link Collection#add}) |
389 |
|
*/ |
390 |
|
public boolean add(E e) { |
391 |
< |
++modCount; |
391 |
> |
modCount++; |
392 |
|
int s = size; |
393 |
|
if (s >= elementData.length) |
394 |
|
growArray(s + 1); |
410 |
|
int s = size; |
411 |
|
if (index > s || index < 0) |
412 |
|
rangeException(index, s); |
413 |
< |
++modCount; |
413 |
> |
modCount++; |
414 |
|
if (s >= elementData.length) |
415 |
|
growArray(s + 1); |
416 |
|
System.arraycopy(elementData, index, |
430 |
|
*/ |
431 |
|
public E remove(int index) { |
432 |
|
int s = size - 1; |
433 |
< |
if (index < 0 || index > s) |
433 |
> |
if (index > s) |
434 |
|
rangeException(index, size); |
435 |
|
modCount++; |
436 |
|
E oldValue = (E)elementData[index]; |
438 |
|
if (numMoved > 0) |
439 |
|
System.arraycopy(elementData, index + 1, |
440 |
|
elementData, index, numMoved); |
441 |
< |
elementData[s] = null; // forget removed element |
441 |
> |
elementData[s] = null; |
442 |
|
size = s; |
443 |
|
return oldValue; |
444 |
|
} |