16 |
|
* stay small, read-only operations |
17 |
|
* vastly outnumber mutative operations, and you need |
18 |
|
* to prevent interference among threads during traversal. |
19 |
+ |
* <li>It is thread-safe. |
20 |
|
* <li>Mutative operations(add, set, remove, etc) are expensive |
21 |
|
* since they usually entail copying the entire underlying array. |
22 |
|
* <li>Iterators do not support the mutative remove operation |
45 |
|
* |
46 |
|
* public void update() { |
47 |
|
* changeState(); |
48 |
< |
* Iterator it = handlers.iterator(); |
48 |
> |
* Iterator<Handler> it = handlers.iterator(); |
49 |
|
* while (it.hasNext()) |
50 |
|
* it.next().handle(); |
51 |
|
* } |
52 |
|
* } |
53 |
|
* </pre> |
53 |
– |
* @see CopyOnWriteArrayList |
54 |
|
* |
55 |
|
* <p>This class is a member of the |
56 |
|
* <a href="{@docRoot}/../guide/collections/index.html"> |
57 |
|
* Java Collections Framework</a>. |
58 |
|
* |
59 |
+ |
* @see CopyOnWriteArrayList |
60 |
|
* @since 1.5 |
61 |
|
* @author Doug Lea |
62 |
|
* @param <E> the type of elements held in this collection |