Class WritableSet<E>

Type Parameters:
E - the type of elements in this set
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>, IObservable, IObservableCollection<E>, IObservableSet<E>

public class WritableSet<E> extends ObservableSet<E>
Mutable (writable) implementation of IObservableSet.

This class is thread safe. All state accessing methods must be invoked from the current realm. Methods for adding and removing listeners may be invoked from any thread.

Since:
1.0
  • Constructor Details

    • WritableSet

      public WritableSet()
      Constructs a new empty instance in the default realm with a null element type.
    • WritableSet

      public WritableSet(Collection<? extends E> c, Object elementType)
      Constructs a new instance in the default realm containing the elements of the given collection. Changes to the given collection after calling this method do not affect the contents of the created WritableSet.
      Parameters:
      c - elements to initialize this set with
      elementType - can be null
    • WritableSet

      public WritableSet(Realm realm)
      Constructs a new empty instance in the given realm and a null element type.
      Parameters:
      realm - the realm
    • WritableSet

      public WritableSet(Realm realm, Collection<? extends E> c, Object elementType)
      Constructs a new instance in the default realm with the given element type, containing the elements of the given collection. Changes to the given collection after calling this method do not affect the contents of the created WritableSet.
      Parameters:
      realm - the realm
      c - elements to initialize this set with
      elementType - can be null
  • Method Details