Overview

edit

The collections are in the Meziantou.Framework.Collections namespace. They complement the collections of .NET for needs that come up regularly.

CollectionUse it toPage
CircularBuffer<T>Keep a fixed number of items, optionally overwriting the oldest onesQueues and buffers
DoubleEndedQueue<T>Add and remove items at both ends, and read them by indexQueues and buffers
LimitList<T>Keep the most recent items, such as a list of recent filesQueues and buffers
AppendOnlyCollection<T>Add items from several threads while others read themQueues and buffers
SortedList<T>Keep items sorted, duplicates included, with access by indexSorted collections
SkipList<T>Keep unique items sortedSorted collections
BTree<T>Keep unique items sorted in a B-treeSorted collections
MultiValueDictionary<TKey, TValue>Associate several values with a keyDictionaries and tries
Trie<TValue>Find the keys that start with a prefixDictionaries and tries
PruningRadixTreeSuggest the most frequent completions of a prefixDictionaries and tries
UnsafeListDictionary<TKey, TValue>Build a list of key-value pairs without checking for duplicatesDictionaries and tries
ImmutableEquatableArray<T>, ImmutableEquatableSet<T>, ImmutableEquatableDictionary<TKey, TValue>Compare collections by their contentEquatable collections

The collections are not thread-safe, except AppendOnlyCollection<T> and the immutable equatable collections. For thread-safe collections, see concurrent collections in Meziantou.Framework.Threading.