290 |
|
* @see #contains(Object) |
291 |
|
*/ |
292 |
|
public boolean containsAll(Collection<?> c) { |
293 |
< |
Iterator<?> it = c.iterator(); |
294 |
< |
while (it.hasNext()) |
295 |
< |
if (!contains(it.next())) |
293 |
> |
for (Object e : c) |
294 |
> |
if (!contains(e)) |
295 |
|
return false; |
296 |
|
return true; |
297 |
|
} |
316 |
|
*/ |
317 |
|
public boolean addAll(Collection<? extends E> c) { |
318 |
|
boolean modified = false; |
319 |
< |
Iterator<? extends E> it = c.iterator(); |
320 |
< |
while (it.hasNext()) { |
322 |
< |
if (add(it.next())) |
319 |
> |
for (E e : c) |
320 |
> |
if (add(e)) |
321 |
|
modified = true; |
324 |
– |
} |
322 |
|
return modified; |
323 |
|
} |
324 |
|
|