UnmodifiableCollectiveQueue<E>.bind constructor

UnmodifiableCollectiveQueue<E>.bind(
  1. Collective bind, {
  2. bool unmodifiableElement = true,
  3. CollectiveQueueProperties<E>? properties,
  4. Iterable<E>? elements,
})

Creates an unmodifiable queue by binding to an existing Collective.

Parameters:

  • bind: The queue to make unmodifiable
  • unmodifiableElement: If true, elements that are cells will be converted to their unmodifiable versions
  • properties: Optional properties to configure the queue
  • elements: Optional elements to use instead of the bound queue's elements

Implementation

UnmodifiableCollectiveQueue.bind(Collective bind, {bool unmodifiableElement = true, CollectiveQueueProperties<E>? properties, Iterable<E>? elements})
    : super(properties ?? CollectiveQueueProperties<E>(), unmodifiableElement: unmodifiableElement,
    elements: elements ?? (unmodifiableElement ? bind.whereType<E>() : bind.whereType<E>().map<E>((e) => e is Cell ? e.unmodifiable as E : e))
);