Class ConcurrentCollector<T>
A collector that allows for concurrent adding of items, as well as non-thread-safe clearing and accessing of the underlying colletion.
public class ConcurrentCollector<T> : IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
T
The element type in the collection.
- Inheritance
-
ConcurrentCollector<T>
- Implements
-
IEnumerable<T>
- Extension Methods
Constructors
ConcurrentCollector(int)
Parameters
capacity
int
Properties
Count
Gets the number of elements in the collection.
Property Value
- int
The number of elements in the collection.
this[int]
Gets the element at the specified index in the read-only list.
Parameters
index
intThe zero-based index of the element to get.
Property Value
- T
The element at the specified index in the read-only list.
Items
Property Value
- T[]
Methods
Add(T)
Parameters
item
T
Returns
AddRange(IReadOnlyList<T>)
Parameters
collection
IReadOnly <T>List
Clear(bool)
Parameters
fastClear
bool
Close()
Consolidates all added items into a single consecutive array. It is an error to access Items after adding elements, but before closing.