See Also: CopyOnWriteArraySet Members
A Java.Util.ISet that uses an internal Java.Util.Concurrent.CopyOnWriteArrayList for all of its operations. Thus, it shares the same basic properties:
Sample Usage. The following code sketch uses a copy-on-write set to maintain a set of Handler objects that perform some action upon state updates.
java Example
class Handler { void handle(); ... class X { private final CopyOnWriteArraySet handlers = new CopyOnWriteArraySet(); public void addHandler(Handler h) { handlers.add(h); } private long internalState; private synchronized void changeState() { internalState = ...; } public void update() { changeState(); for (Handler handler : handlers) handler.handle(); } }}