Enhanced C#
Language of your choice: library documentation
Namespaces | Classes | Enumerations | Functions
Loyc.Collections Namespace Reference

Contains general-purpose interfaces (Loyc.Collections.IListSource<T>, ranges, etc.), collection implementations (Loyc.Collections.DList<T>, Loyc.Collections.WeakValueDictionary<K,V>, etc.), extension methods (Loyc.Collections.LCExt, Loyc.Collections.EnumerableExt, etc.), helper classes (Loyc.Collections.EmptyList<T>, (Loyc.Collections.Repeated<T>, etc.), and adapter classes (Loyc.Collections.ListSlice<T>, Loyc.Collections.BufferedSequence<T>, etc.). More...

Namespaces

namespace  Impl
 Contains helper classes and base classes for implementing collections (Loyc.Collections.Impl.InternalList<T>, Loyc.Collections.Impl.ListExBase<T>, Loyc.Collections.Impl.ListSourceBase<T>, etc.) Also contains the AList and CPTrie node classes, which perhaps should not be public...
 
namespace  MutableListExtensionMethods
 Contains extension methods for ICollection<T> and IList<T> that are possibly ambiguous when included in the same namespace as extension methods for IReadOnlyCollection<T> and IReadOnlyList<T>.
 

Classes

class  AList
 An all-purpose list structure with the following additional features beyond what's offered by List<T>: fast insertion and deletion (O(log N)), batch insertion and deletion, observability, fast cloning, freezability, and fast splitting and joining of large collections. More...
 
class  AListBase
 Common base class of AList<T> and SparseAList<T>. Most of the functionality of the two types is identical, so this class is used to share code between them. More...
 
class  AListExt
 
struct  AListReverseView
 A reverse view of an AList. More...
 
class  AListStatisticTracker
 This class efficiently lets you keep track of simple commutative statistics (such as total, average, sum of squares, and min/max) derived from the items of AList<T> and its variants (BList, BDictionary, and BMultiMap). More...
 
class  AListStatisticTrackerBase
 Base class that helps efficiently keep track of statistics about the contents of one or more AListBase<K, T> objects (including derived classes such as AList, BList, BDictionary and BMultiMap). Usually you'll use one of the derived classes instead, e.g. AListSumTracker<K,T>. More...
 
class  AListSumTracker
 This class incrementally recomputes the sum of an AList<T> (or its variants - BList, BDictionary, and BMultiMap). More...
 
class  ArrayOf4
 
struct  ArraySlice
 Adapter: Provides access to a section of an array. More...
 
class  BDictionary
 An sorted dictionary that is efficient for all operations and offers indexed access to its list of key-value pairs. More...
 
class  Bijection
 A bijection is a one-to-one function and its inverse. It is implemented with a pair of dictionaries, one that maps K1 to K2 and another that maps K2 to K1. More...
 
class  BList
 An sorted in-memory list that is efficient for all operations and offers indexed access to its list. More...
 
class  BMultiMap
 An sorted dictionary that allows multiple values to be associated with a single key. More...
 
class  BufferedSequence
 Adapter: This class wraps an IEnumerator<T> or IEnumerable<T> into an IListSource<T>, lazily reading the sequence as TryGet is called. More...
 
class  CG
 Contains global functions of Loyc.Collections that don't belong in any specific class. More...
 
class  CollectionAsReadOnly
 Adapter: a read-only wrapper that implements ICollection(T) and IReadOnlyCollection(T), returned from EnumerableExt.AsReadOnly<T>. More...
 
class  CollectionDebugView
 This helper class gives a nice view of a custom collection within the debugger. More...
 
class  CollectionSource
 
class  CollectionWithChangeEvents
 A collection wrapper that provides ListChanging and ListChanged events. Shorthand for Loyc.Collections.Impl.CollectionWithChangeEvents<T,ICollection<T>>. More...
 
class  CPStringTrie
 A compact patricia trie that uses strings as keys. More...
 
class  CPTrie
 Compact patricia tree class that stores keys as byte arrays. This class is intended to be use as a base class; a derived class can give meaning to the byte arrays, e.g. CPStringTrie encodes strings into byte arrays so they can be placed in the trie. More...
 
class  CPTrieBenchmark
 
class  CPTrieTests
 Test suite for CPStringTrie, CPByteTrie and CPIntTrie
 
class  CPValueCollection
 Provides read-only access to the values of a CPTrie. More...
 
class  DictionaryDebugView
 Workaround for a limitation of the debugger: it doesn't support CollectionDebugView<T> when T is KeyValuePair<K,V>. This class is identical, except that T is replaced with KeyValuePair{K,V}. More...
 
class  DictionaryExt
 Extension methods for Dictionary<K,V>, IDictionary<K,V> and IDictionaryEx<K, V>. More...
 
class  DictionaryWithChangeEvents
 A dictionary wrapper that provides ListChanging and ListChanged events. Shorthand for Loyc.Collections.Impl.DictionaryWithChangeEvents<K,V,IDictionary<K,V>>. More...
 
class  DList
 A compact auto-enlarging list that efficiently supports supports insertions at the beginning or end of the list. More...
 
class  EmptyArray
 EmptyArray<T>.Value lets you avoid allocating an empty array on the heap. More...
 
class  EmptyEnumerator
 Helper class: an empty enumerator. More...
 
class  EmptyList
 Helper class: EmptyList<T>.Value is a read-only empty list. More...
 
class  EmptySequenceException
 An exception thrown by methods or properties that require a non-empty sequence but were provided with an empty sequence. More...
 
class  EnumerableExt
 Additional extension methods for IEnumerable<T>, IReadOnlyCollection<T>, and ICollection<T>, beyond what LINQ provides. More...
 
class  EnumerationException
 An exception thrown by an enumerator when it detects that the collection was modified after enumeration started but before it finished. More...
 
class  EnumeratorBase
 Base class to help you implement the standard IEnumerator{T} interface. All you have to do is override MoveNext() and, when successful, set the Current property. More...
 
struct  FVList
 A reference to a FVList, a so-called persistent list data structure. More...
 
class  FWList
 FWList is the mutable variant of the FVList data structure. More...
 
class  Heap
 
interface  IAdd
 An interface for depositing items. Includes only an Add(T) method. More...
 
interface  IAddRange
 An interface for the AddRange method, part of IListEx<T> and ICollectionEx<T>, for collection types that can add multiple items in one method call. More...
 
interface  IArray
 This interface models the capabilities of an array: getting and setting elements by index, but not adding or removing elements. More...
 
interface  IArraySink
 Represents a write-only array. More...
 
interface  IAutoCreatePool
 Represents a pool of objects in which an object is automatically created when requested by its key. More...
 
interface  IAutoSizeArray
 An auto-sizing array is a list structure that allows you to modify the element at any index, including indices that don't yet exist; the collection automatically adds missing indices. More...
 
interface  IBinumerable
 Interface for a collection that can return IBinumerator<T>s pointing to the beginning and end of the collection. More...
 
interface  IBinumerator
 Extends the "enumerator" concept to allow backward enumeration. More...
 
interface  IBRange
 A bidirectional range. Allows you to read or remove the first or last element in a range. More...
 
interface  IBRangeEx
 A bidirectional range that can perform operations such as intersection and overlap tests on pairs of ranges of the same type. More...
 
interface  ICharSource
 A read-only list of characters plus a Slice(int,int) method. More...
 
interface  ICollectionAndReadOnly
 This interface is meant to be implemented by read-only sequence types that originally implemented ICollection<T> and want to now implement IReadOnlyCollection<T>. It is recommended to implement ICollectionAndSource<T> instead, but the latter requires you to implement a couple of additional methods. More...
 
interface  ICollectionAndSource
 This interface is to be implemented by read-only sequence types that still want to be compatible with APIs that accept ICollection<T>. (writable collections should implement ICollectionImpl<T> instead.) More...
 
interface  ICollectionEx
 This interface is intended to be implemented by editable collection classes that are not indexable lists nor dictionaries. More...
 
interface  ICollectionExWithChangeEvents
 Combines ICollectionEx<T> with INotifyListChanging<T, ICollection<T>> and INotifyListChanged<T, ICollection<T>>. This exists for completeness; as of 2020/12 there are no implementations. More...
 
interface  ICollectionImpl
 This interface is intended to be implemented by editable collection classes that are not indexable lists nor dictionaries. It is recommended to implement ICollectionEx<T> instead, but the latter requires more effort. More...
 
interface  ICollectionSink
 Represents a write-only collection: you can modify it, but you cannot learn what it contains. More...
 
interface  ICollectionSource
 A variation of IReadOnlyCollection that provides the Contains() and CopyTo() methods from ICollection. More...
 
interface  ICollectionWithChangeEvents
 Combines ICollection<T> with INotifyListChanging<T, ICollection<T>> and INotifyListChanged<T, ICollection<T>>. More...
 
interface  IContains
 
interface  ICount
 Holds the Count property found in nearly all collection interfaces. More...
 
interface  IDeque
 Represents a double-ended queue that allows items to be added or removed at the beginning or end. More...
 
interface  IDictionaryAndReadOnly
 This interface is meant to be implemented by read-only dictionary classes that originally implemented IDictionary<K, V> and now want to add its read-only version, IReadOnlyDictionary<K, V>. More...
 
interface  IDictionaryEx
 Combines IDictionary, IReadOnlyDictionary, and IDictonarySink with a few additional methods. More...
 
interface  IDictionaryExWithChangeEvents
 
interface  IDictionaryImpl
 This interface is intended to be implemented by all Loyc collections that implement IDictionary<K,V>. It combines the original IDictionary<K,V> interface with its component interfaces IReadOnlyDictionary<K,V> and IDictionarySink<K,V>. More...
 
interface  IDictionarySink
 Represents a write-only dictionary class. More...
 
interface  IDictionaryWithChangeEvents
 
interface  IFRange
 A forward range. Allows you to read the first element from the range or skip it. The forward range lays the foundation for IBRange<T> and IRange<T>. More...
 
interface  IIndexed
 Represents the essence of a dictionary, which returns a value given a key. More...
 
interface  IIsEmpty
 Holds the IsEmpty property that tells you if a collection is empty. More...
 
interface  IListAndListSource
 This interface is to be used by read-only sequences that nevertheless wish to be compatible with APIs that accept IList<T>. (writable collections should implement IListImpl<T> instead.) More...
 
interface  IListAndReadOnly
 This interface is meant to be implemented by read-only sequence classes that originally implemented IList<T> and want to now implement IReadOnlyList<T> and IReadOnlyCollection<T>. It is recommended to implement IListAndListSource<T> instead, but the latter requires you to implement more methods. More...
 
interface  IListEx
 This interface combines the original IList(T) interface with others - IListSource(T), ISinkList(T), IArray(T) - and some additional methods (e.g. RemoveAll, InsertRange). More...
 
interface  IListExWithChangeEvents
 
interface  IListImpl
 This interface is intended to be implemented by all Loyc collections that implement IList<T>. It combines the original IList<T> interface with its component interfaces IReadOnlyList<T> and IListSink<T>, plus a little bit of additional functionality in IListSource<T>. More...
 
interface  IListRangeMethods
 The batch-operation methods of IListEx<T>, mainly for collection types that can add or remove multiple items in one method call. More...
 
interface  IListSink
 Represents a write-only indexable list class. More...
 
interface  IListSource
 A read-only list indexed by an integer. More...
 
interface  IListWithChangeEvents
 
interface  IMBinumerator
 A mutable bidirectional enumerator interface. Please note that the "Remove" method always moves to the next item, even though the Binumerator is capable of moving backward. More...
 
interface  IMBRange
 A mutable bidirectional range. More...
 
interface  IMEnumerator
 A mutable enumerator interface. Provides a "Remove" method like Java iterators have, and allows you to modify the current item. More...
 
interface  IMFRange
 A mutable forward range. More...
 
interface  IMRange
 A mutable random-access range. More...
 
class  IndexedAList
 A simple wrapper around AList that includes an AListIndexer<K,T> that can be used to find items relatively quickly in a large list. When an index is built and the list is large, it accelerates IndexOf(item), Contains(item) and Remove(item). More...
 
interface  INegArray
 This interface models the capabilities of an array: getting and setting elements by index, but not adding or removing elements. This interface is the counterpart to IListSource<T> for lists whose minimum index is not (necessarily) zero. More...
 
interface  INegAutoSizeArray
 An auto-sizing array is a list structure that allows you to modify the element at any index, including indexes that don't yet exist; the collection automatically adds missing indexes. More...
 
interface  INegDeque
 Represents a Deque that supports negative indexes. In this kind of Deque, pushing and popping elements does not affect the indexes of the other elements in the collection. More...
 
interface  INegListSource
 This interface is the counterpart to IListSource<T> for lists whose minimum index is not (necessarily) zero. More...
 
interface  INotifyListChanged
 Encapsulates a ListChanged event that notifies listeners that a list has changed, such as when items are added or removed or the whole list is refreshed. More...
 
interface  INotifyListChanging
 Encapsulates the ListChanging event that notifies listeners of dynamic changes to a collection, such as when items are about to be added and removed or the whole list is about to be refreshed. More...
 
class  InvertibleSet
 An immutable set that can be inverted. For example, an InvertibleSet<int> could contain "everything except 4 and 10", or it could contain a positive set such as "1, 2, and 3". More...
 
class  InvertibleSetTests
 
interface  IOptimize
 Interface for an Optimize() method. More...
 
interface  IPop
 Represents a collection that produces a sequence of items, and can return the next item without popping it (the Peek operation). More...
 
class  IPopExt
 
interface  IPriorityQueue
 Represents a priority queue, in which Pop() always returns the largest or smallest item. More...
 
interface  IPush
 Represents a collection that accepts a sequence of items. More...
 
interface  IQueue
 Represents a FIFO (first-in-first-out) queue (or a priority queue if IPriorityQueue<ThisAssembly> is also implemented). More...
 
interface  IRange
 A random-access range, also known as a "slice". Allows you to narrow down the range like IBRange<T> does, and also provides random access via IListSource<T>. More...
 
interface  IRangeEx
 A random-access range that can perform operations such as intersection and overlap tests on pairs of ranges of the same type. More...
 
interface  ISetImm
 An immutable set of type SetT with elements of type T. More...
 
interface  ISetOperations
 Set-combining operations: With, Without, Union, Intersect, Except, Xor. More...
 
interface  ISetTests
 Set testing operations.
 
interface  ISparseList
 Represents a sparse list that allows insertion and removal of items and empty spaces. In a sparse list, some spaces can be "clear" meaning that they have no value. More...
 
interface  ISparseListEx
 A sparse list that supports additional methods including InsertRange(int, ISparseListSource<T>). More...
 
interface  ISparseListSource
 Represents a read-only indexed list in which parts of the index space may be unused or "clear". More...
 
interface  IStack
 Represents a LIFO (last-in-first-out) stack. More...
 
interface  ITryGet
 Enables access to TryGet extension methods for retrieving items from a collection without risk of exceptions. More...
 
class  KeyAlreadyExistsException
 An exception thrown by dictionary objects when they are asked to "add" a key-value pair that already exists. More...
 
class  KeyCollection
 Adapter: this is a read-only collection of Keys read from a generic IDictionary. It is a modified version of Dictionary{TKey, TValue}.KeyCollection from the Mono project, changed to use IDictionary instead of Dictionary. More...
 
class  LCExt
 Extension methods for Loyc Collection interfaces (such as IListSource<T>). More...
 
class  LCInterfaces
 Extension methods for Loyc collection interfaces More...
 
class  LinqToLists
 This class enhances LINQ-to-Objects with extension methods that preserve the interface (e.g. Take(IList<int>) returns a struct that implements IList<int>) or have higher performance than the ones in System.Linq.Enumerable. More...
 
class  ListAsListSource
 Helper type returned from LCExt.AsListSource<T>. More...
 
struct  ListChangeInfo
 Contains information about how a collection is about to change. More...
 
class  ListExt
 Extension methods and helper methods for List<T>, IList<T>, IReadOnlyList<T>, arrays, IListSource<T>, and for related mutable interfaces such as IArray<T>. More...
 
struct  ListSlice
 Adapter: a wrapper of a list that provides a view of a range of elements. Objects of this type are returned from ListExt.Slice<T> More...
 
class  ListSourceAsList
 Adapter: a read-only wrapper that implements IList(T) and IListSource(T), returned from LCExt.AsList<T>. More...
 
class  ListSourceAsSparse
 Adapter from IListSource<T> to ISparseListSource<T>. More...
 
class  ListSourceDebugView
 This helper class gives a nice view of a custom collection within the debugger. More...
 
class  ListWithChangeEvents
 A list wrapper that provides ListChanging and ListChanged events. Shorthand for Loyc.Collections.Impl.ListWithChangeEvents<T,IList<T>>. More...
 
class  Map
 An immutable dictionary. More...
 
class  MapOrMMap
 Common base class that contains code shared between Map<K,V> and MMap<K,V>. More...
 
class  MaxHeap
 Encapsulates algorithms for a max-heap, i.e. a priority queue that always knows the largest item and can remove it in O(log Count) time, or add a new item in O(log Count) time. More...
 
class  MaxHeapInList
 This priority queue wrapper type is returned from the AsMaxHeap() extension method. More...
 
class  MinHeap
 Encapsulates algorithms for a min-heap, i.e. a priority queue that always knows the smallest item and can remove it in O(log Count) time, or add a new item in O(log Count) time. More...
 
class  MinHeapInList
 This priority queue wrapper type is returned from the AsMinHeap() extension method. More...
 
class  MMap
 A dictionary class built on top of InternalSet<KeyValuePair<K,V>>. More...
 
class  MSet
 A mutable set. More...
 
struct  NegList
 Adapter: provides a view of an IList<T> in which the Count is the same, but the minimum index is not necessarily zero. Returned from LCExt.AsNegList<T>(IListSource<T>,int). More...
 
struct  NegListSlice
 Adapter: a random-access range for a slice of an INegListSource<T>. More...
 
struct  NegListSource
 Adapter: provides a view of an IListSource<T> in which the Count is the same, but the minimum index is not necessarily zero. Returned from LCExt.AsNegList<T>(IListSource<T>,int). More...
 
struct  NestedEnumerable
 Helper type. You pass a cloneable Frame object to the constructor, and then a copy of this Frame is used to construct a new NestedEnumerator<Frame,T> each time the user calls GetEnumerator. More...
 
struct  NestedEnumerator
 Helper class. An enumerator that helps enumerate tree data structures. It maintains a virtual call stack that avoids the performance hit of using nested "yield return" statements in C#. More...
 
struct  NumRange
 Represents a range of integers of a specified data type. More...
 
struct  RangeEnumerator
 Helper struct: enumerates through a forward range (IFRange<T>), calling the range methods through R instead of through IFRange<T>. More...
 
class  RangeExt
 Extension/helper methods for ranges. More...
 
class  ReadOnlyAsCollection
 A read-only wrapper that implements ICollection(T) and ISource(T), returned from LCExt.AsCollection<T> More...
 
class  ReadOnlyListAsListSource
 Helper type returned from LCExt.AsListSource<T>(IReadOnlyList<T>). More...
 
struct  Repeated
 Helper struct. A sequence that stores one value, but acts like a list in which that value is repeated a specified number of times. Returned from ListExt.Repeat<T>(T, int). More...
 
struct  ReverseBinumerator
 Adapter: a IBinumerator<T> that swaps the MoveNext() and MovePrev() methods. More...
 
struct  ReverseComparer
 Reverses the order used by an IComparer object. More...
 
struct  ReversedList
 Adapter: a reversed of an IList<T>. TODO: unit tests. More...
 
class  ReversedListSource
 Adapter: reversed view of IListSource<T> returned from LinqToLists.Reverse<T>. More...
 
struct  ROLSlice
 Adapter: a random-access range for a slice of an IReadOnlyList<T>. More...
 
class  SelectCollection
 Helper class for LinqToLists. More...
 
class  SelectDictionaryFromKeys
 An adapter that converts a collection of keys to an IReadOnlyDictionary. Used by EnumerableExt.AsReadOnlyDictionarybased on a function that can obtain a value for a given key. More...
 
class  SelectList
 Helper class: provides a modified view of an IList by transforming each element on-demand. Objects of this type are returned from MutableListExtensionMethods.LinqToLists.Select<T,TResult>(IList<T>,Func<T,TResult>) More...
 
class  SelectListSource
 Helper class: provides a modified view of an IListSource by transforming each element on-demand. Objects of this type are returned from LinqToLists.Select<T,TResult>(IListSource<T>,Func<T,TResult>) More...
 
class  SelectReadOnlyCollection
 Helper class for LinqToLists. More...
 
class  SelectReadOnlyList
 Helper class: provides a modified view of an IListSource by transforming each element on-demand. Objects of this type are returned from LinqToLists.Select<T,TResult>(IListSource<T>,Func<T,TResult>) More...
 
struct  Set
 An immutable set. More...
 
class  SimpleCache
 A cache designed to save memory by sharing instances of identical strings and other immutable objects. More...
 
class  SimpleCacheTests
 
struct  Slice_
 Adapter: a random-access range for a slice of an IListSource<T>. More...
 
class  SparseAList
 A sparse A-List that implements ISparseList<T>. More...
 
class  TryGetExt
 Standard extension methods for ITryGet<K, V>. More...
 
class  UpCastListSource
 Helper class for treating a collection of a derived type as a collection of a base type or interface. More...
 
class  UpCastSource
 Helper class for treating a collection of a derived type as a collection of a base type or interface. More...
 
class  ValueCollection
 Adapter: this is a read-only collection of Values read from a generic IDictionary. It is a modified version of Dictionary{TKey, TValue}.ValueCollection from the Mono project, changed to use IDictionary instead of Dictionary. More...
 
struct  VList
 VList represents a reference to a reverse-order FVList. More...
 
class  VListBlock
 VListBlock implements the core functionality of FVList, VList, FWList and WList. It is not intended to be used directly. More...
 
class  VListBlockArray
 Implementation of VListBlock(of T) that contains an array. It is always initialized with at least one item, and items cannot be removed unless the list is mutable. More...
 
class  VListBlockOfTwo
 The tail of a VList contains only one or two items. To improve efficiency slightly, these two-item lists are represented by a VListBlockOfTwo, which is more compact than VListBlockArray. More...
 
class  WeakKeyComparer
 Compares objects of the given type or WeakKeyReferences to them for equality based on the given comparer. Note that we can only implement IEqualityComparer<T> for T = object as there is no other common base between T and WeakKeyReference<T>. We need a single comparer to handle both types because we don't want to allocate a new weak reference for every lookup. More...
 
class  WeakKeyDictionary
 A dictionary with weak keys. More...
 
class  WeakKeyReference
 Provides a weak reference to an object of the given type to be used in a WeakDictionary along with the given comparer. More...
 
class  WeakValueDictionary
 A dictionary in which the values are weak. When a value has been garbage- collected, the dictionary acts as if the key is not present (except the Remove() method, which saves time by not checking whether the value is dead.) More...
 
class  WList
 WList is the mutable variant of the VList data structure. More...
 
class  WListBase
 Shared base class of FWList and WList. More...
 
class  WListProtected
 WList implementation in which the WList operations are only accessible to a derived class. More...
 

Enumerations

enum  DictEditMode {
  DictEditMode.Retrieve = 0, DictEditMode.ReplaceIfPresent = 1, DictEditMode.AddIfNotPresent = 2,
  DictEditMode.AddOrReplace = 3
}
 Helper enum for IDictionaryEx<K, V>.GetAndEdit. More...
 
enum  AListOperation {
  AListOperation.Remove = -1, AListOperation.Retrieve = 0, AListOperation.ReplaceIfPresent = 1,
  AListOperation.__AddThreshold = 2, AListOperation.AddIfNotPresent = 2, AListOperation.AddOrReplace = 3,
  AListOperation.Add = 5, AListOperation.AddOrThrow = 6
}
 Indicates the way an add operation (such as BList<T>.Do should behave when an item being added to a set or list is a duplicate of an item that is already present, or when the key of a key-value pair being added to a dictionary is a duplicate of a key that is already present in the dictionary. More...
 
enum  XfAction {
  XfAction.Drop, XfAction.Keep, XfAction.Change,
  XfAction.Repeat
}
 Values that can be returned by the VListTransformer function that the user passes to the Transform method in FVList, VList, FWList or WList. More...
 

Functions

delegate void ListChangingHandler< T, TSender > (TSender sender, ListChangeInfo< T > args)
 Represents the method that handles the INotifyListChanging<T, TSender>.ListChanging event. More...
 
delegate void ListChangingHandler< T > (IListSource< T > sender, ListChangeInfo< T > args)
 
delegate XfAction VListTransformer< T > (int i, ref T item)
 User-supplied list transformer function. More...
 

Detailed Description

Contains general-purpose interfaces (Loyc.Collections.IListSource<T>, ranges, etc.), collection implementations (Loyc.Collections.DList<T>, Loyc.Collections.WeakValueDictionary<K,V>, etc.), extension methods (Loyc.Collections.LCExt, Loyc.Collections.EnumerableExt, etc.), helper classes (Loyc.Collections.EmptyList<T>, (Loyc.Collections.Repeated<T>, etc.), and adapter classes (Loyc.Collections.ListSlice<T>, Loyc.Collections.BufferedSequence<T>, etc.).

Enumeration Type Documentation

◆ AListOperation

Indicates the way an add operation (such as BList<T>.Do should behave when an item being added to a set or list is a duplicate of an item that is already present, or when the key of a key-value pair being added to a dictionary is a duplicate of a key that is already present in the dictionary.

All the "add" operations are deliberately listed last, so that AListBase<K,T>.DoSingleOperation can use a greater-than operator to figure out whether an item may be added or not. The numeric values 0 through 3 are based on DictEditMode.

Enumerator
Remove 

Remove the item with the specified key if present.

Retrieve 

Default operation. The item with the specified key will be retrieved. The tree will not be modified.

ReplaceIfPresent 

Replace an existing item/key if present, or do nothing if there is no matching item/key.

__AddThreshold 

Lowest-numbered "add" command. For internal use only.

AddIfNotPresent 

A new item will be added if its key doesn't match an existing element. If the item already exists, it is not replaced.

AddOrReplace 

A new item will replace an item that has the same key. If the collection already contains multiple instances of the item/key, the instance to be replaced is undefined.

Add 

A new item will be added unconditionally, without affecting existing elements, in no particular order with respect to existing items that have the same key.

AddOrThrow 

The item will be added if its key is not already present, but KeyAlreadyExistsException or InvalidOperationException will be thrown if the new item is equal to an existing element. If this exception occurs during an AddRange() operation, some of the items may have already been added successfully, and the changes will not be rolled back unless otherwise specified in the documentation of the method that performs the add operation.

◆ DictEditMode

Helper enum for IDictionaryEx<K, V>.GetAndEdit.

Enumerator
Retrieve 

Do not change the collection.

ReplaceIfPresent 

Replace an existing pair if present, or do nothing if no matching key.

AddIfNotPresent 

Add a new item if the key doesn't match an existing pair, or do nothing if it does.

AddOrReplace 

Insert a key-value pair, replacing an existing one if the key already exists.

◆ XfAction

Values that can be returned by the VListTransformer function that the user passes to the Transform method in FVList, VList, FWList or WList.

Enumerator
Drop 

Do not include the item in the output list

Keep 

Include the original item in the output list

Change 

Include the modified item in the output list

Repeat 

Include the modified item in the output, and transform it again

Function Documentation

◆ ListChangingHandler< T, TSender >()

delegate void Loyc.Collections.ListChangingHandler< T, TSender > ( TSender  sender,
ListChangeInfo< T >  args 
)

Represents the method that handles the INotifyListChanging<T, TSender>.ListChanging event.

Parameters
senderThe collection that changed.
argsInformation about the change.

◆ VListTransformer< T >()

delegate XfAction Loyc.Collections.VListTransformer< T > ( int  i,
ref T  item 
)

User-supplied list transformer function.

Parameters
itemAn item from the FVList or VList
iIndex of the item
Returns
See the documentation of FVList.Transform() for instructions and possible return values.