Java.Util.Concurrent.CopyOnWriteArraySet Class
A Java.Util.ISet that uses an internal Java.Util.Concurrent.CopyOnWriteArrayList for all of its operations.

See Also: CopyOnWriteArraySet Members

Syntax

[Android.Runtime.Register("java/util/concurrent/CopyOnWriteArraySet", DoNotGenerateAcw=true)]
public class CopyOnWriteArraySet : Java.Util.AbstractSet, Java.IO.ISerializable, IDisposable

Remarks

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();
   }
 }}

See Also

[Android Documentation]

Requirements

Namespace: Java.Util.Concurrent
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1