Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Namespaces | Classes | Enumerations | Functions
Package Loyc.Collections

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

package  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...
 
package  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

struct  AddAdapter< T >
 
class  AddAdapter< T, Context >
 
class  AList< T >
 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< K, T >
 Base class for the indexed tree-based data structures known as AList{T} and BList{T}. More...
 
class  AListBase< T >
 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< K, T >
 A reverse view of an AList. More...
 
class  AListStatisticTracker< K, T >
 This class incrementally updates a Statistic object based on changes to AList{T} and its variants (BList, BDictionary, and BMultiMap). More...
 
class  AListStatisticTracker< K, T, TSummary >
 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  AListStatisticTracker< T >
 
class  AListStatisticTrackerBase< K, T, TSummary >
 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< K, T >
 This class incrementally recomputes the sum of an AList{T} (or its variants - BList, BDictionary, and BMultiMap). More...
 
class  AListSumTracker< T >
 
class  ArrayOf4< T >
 
struct  ArraySlice< T >
 Adapter: Provides access to a section of an array. More...
 
class  BDictionary< K, V >
 An sorted dictionary that is efficient for all operations and offers indexed access to its list of key-value pairs. More...
 
class  Bijection< K1, K2 >
 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< T >
 An sorted in-memory list that is efficient for all operations and offers indexed access to its list. More...
 
class  BMultiMap< K, V >
 An sorted dictionary that allows multiple values to be associated with a single key. More...
 
class  BufferedSequence< T >
 Adapter: This class wraps an IEnumerator{T} or IEnumerable{T} into an IListSource{T}, lazily reading the sequence as TryGet is called. More...
 
struct  ByteComparer
 
class  CG
 Contains global functions of Loyc.Collections that don't belong in any specific class. More...
 
class  CollectionAsReadOnly< T >
 Adapter: a read-only wrapper that implements ICollection(T) and IReadOnlyCollection(T), returned from EnumerableExt.AsReadOnly{T}. More...
 
class  CollectionAsSink< T, List >
 Helps implement extension method ListExt.AsSink{T}(ICollection{T}). More...
 
class  CollectionDebugView< T >
 This helper class gives a nice view of a custom collection within the debugger. More...
 
class  CollectionSource
 
class  CollectionWithChangeEvents< T >
 A collection wrapper that provides ListChanging and ListChanged events. Shorthand for Loyc.Collections.Impl.CollectionWithChangeEvents{T,ICollection{T}}. More...
 
class  CPStringTrie< TValue >
 A compact patricia trie that uses strings as keys. More...
 
class  CPTrie< T >
 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< T >
 Provides read-only access to the values of a CPTrie. More...
 
class  DictionaryAsSink< K, V, Dict >
 Helps implement extension method DictionaryExt.AsSink{K, V}(IDictionary{K, V}). More...
 
class  DictionaryDebugView< K, V >
 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< K, V >
 A dictionary wrapper that provides ListChanging and ListChanged events. Shorthand for Loyc.Collections.Impl.DictionaryWithChangeEvents{K,V,IDictionary{K,V}}. More...
 
class  DList
 This class is the same as DList{object} except that it also implements the IList interface. More...
 
class  DList< T >
 A compact auto-enlarging list, similar to List{T}, that efficiently supports supports insertions at the beginning or end of the list. More...
 
class  Empty< T >
 A variety of empty lists. More...
 
class  EmptyArray< T >
 EmptyArray{T}.Value lets you avoid allocating an empty array on the heap. More...
 
class  EmptyEnumerator< T >
 Helper class: an empty enumerator. More...
 
class  EmptyList< T >
 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< T >
 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< T >
 A reference to a FVList, a so-called persistent list data structure. More...
 
class  FWList< T >
 FWList is the mutable variant of the FVList data structure. More...
 
class  Heap
 
interface  IAdd< in T >
 An interface for depositing items. Includes only an Add(T) method. More...
 
interface  IAddRange< in T >
 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< T >
 This interface models the capabilities of an array: getting and setting elements by index, but not adding or removing elements. More...
 
interface  IArraySink< in T >
 Represents a write-only array. More...
 
interface  IAutoCreatePool< in TKey, out TValue >
 Represents a pool of objects in which an object is automatically created when requested by its key. More...
 
interface  IAutoNegArray< T >
 This is a tag interface indicating that the boundaries of the array can be expanded implcitly by writing to an index outside the range. However, the indexer may still throw when reading outside the current boundaries. To avoid exceptions, please use a TryGet extension method. More...
 
interface  IAutoSizeArray< T >
 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< T >
 Interface for a collection that can return IBinumerator{T}s pointing to the beginning and end of the collection. More...
 
interface  IBinumerator< T >
 Extends the "enumerator" concept to allow backward enumeration. More...
 
interface  IBRange< out T >
 A bidirectional range. Allows you to read or remove the first or last element in a range. More...
 
interface  IBRangeEx< R, T >
 A bidirectional range that can perform operations such as intersection and overlap tests on pairs of ranges of the same type. More...
 
interface  IBRangeEx< T >
 A bidirectional range that can perform operations such as intersection and overlap tests on pairs of ranges. More...
 
interface  ICharSource
 A read-only list of characters plus a Slice(int,int) method. More...
 
interface  ICollectionAndReadOnly< T >
 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< T >
 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< T >
 This interface is intended to be implemented by editable collection classes that are not indexable lists nor dictionaries. More...
 
interface  ICollectionExWithChangeEvents< T >
 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< T >
 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< in T >
 Represents a write-only collection: you can modify it, but you cannot learn what it contains. More...
 
interface  ICollectionSource< T >
 A variation of IReadOnlyCollection that provides the Contains() and CopyTo() methods from ICollection. More...
 
interface  ICollectionWithChangeEvents< T >
 Combines ICollection{T} with INotifyListChanging{T, ICollection{T}}. and INotifyListChanged{T, ICollection{T}}. More...
 
interface  IContains< in T >
 
interface  ICount
 Holds the Count property found in nearly all collection interfaces. More...
 
interface  IDeque< T >
 Represents a double-ended queue that allows items to be added or removed at the beginning or end. More...
 
interface  IDictionaryAndReadOnly< K, V >
 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< K, V >
 Combines IDictionary, IReadOnlyDictionary, and IDictonarySink with a few additional methods. More...
 
interface  IDictionaryExWithChangeEvents< K, V >
 
interface  IDictionaryImpl< K, V >
 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}, as well as the trivial interface IMIndexed{K,V}. More...
 
interface  IDictionarySink< in K, in V >
 Represents a write-only dictionary class. More...
 
interface  IDictionarySource< K, V >
 Combines IReadOnlyDictionary{K, V} with related interfaces IIndexed{K, V}, ITryGet{K, V} and ISource{KeyValuePair{K,V}}. More...
 
interface  IDictionaryWithChangeEvents< K, V >
 
interface  IFRange< out T >
 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  IHasFirst< out T >
 Encapsulates a First property (for sequences). More...
 
interface  IHasLast< out T >
 Encapsulates a Last property (for sequences). More...
 
interface  IHasMFirst< T >
 Encapsulates a mutable First property. More...
 
interface  IHasMLast< T >
 Encapsulates a mutable Last property. More...
 
interface  IIndexed< in K, out V >
 Represents the essence of a dictionary, which returns a value given a key. More...
 
interface  IIndexedSink< in K, in V >
 Represents a V this[K key] { set; } property. More...
 
interface  IIsEmpty
 Holds the IsEmpty property that tells you if a collection is empty. More...
 
interface  IListAndListSource< T >
 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< T >
 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< T >
 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< T >
 
interface  IListImpl< T >
 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< in T >
 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< in T >
 Represents a write-only indexable list class. More...
 
interface  IListSource< out T >
 A read-only list indexed by an integer. More...
 
interface  IListWithChangeEvents< T >
 
interface  IMBinumerator< T >
 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< T >
 A mutable bidirectional range. More...
 
interface  IMEnumerator< T >
 A mutable enumerator interface. Provides a "Remove" method like Java iterators have, and allows you to modify the current item. More...
 
interface  IMFRange< T >
 A mutable forward range. More...
 
interface  IMIndexed< in K, V >
 Represents the essence of a mutable dictionary: the ability to get or set a value for a key. More...
 
interface  IMRange< T >
 A mutable random-access range. More...
 
class  IndexedAList< T >
 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< T >
 This interface models the capabilities of an array: getting and setting elements by index, but not adding or removing elements. Implementing INegListSource{T} makes it slightly different from IArray{T}, in that indexes can be negative, so there are Min and Max properties. More...
 
interface  INegAutoSizeArray< T >
 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< T >
 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< out T >
 This interface is the counterpart to IListSource{T} for lists whose minimum index is not (necessarily) zero. More...
 
interface  INotifyListChanged< T >
 A version of INotifyListChanging{T, TCollection} in which TCollection is fixed at IListSource{T}. More...
 
interface  INotifyListChanged< T, TCollection >
 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< T >
 A version of INotifyListChanging{T, TCollection} in which TCollection is fixed at IListSource{T}. More...
 
interface  INotifyListChanging< T, TCollection >
 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...
 
struct  InternalDArray< T >
 
class  InvertibleSet< T >
 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< out T >
 
class  IPopExt
 
interface  IPriorityQueue< T >
 Represents a priority queue, in which Pop() always returns the largest or smallest item. More...
 
interface  IPush< in T >
 Encapsulates a Push(T) method. More...
 
interface  IQueue< T >
 Represents a FIFO (first-in-first-out) queue (or a priority queue if IPriorityQueue{ThisAssembly} is also implemented). More...
 
interface  IRange< out T >
 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< R, T >
 A random-access range that can perform operations such as intersection and overlap tests on pairs of ranges of the same type. More...
 
interface  IRangeEx< T >
 A random-access range that can perform operations such as intersection and overlap tests on pairs of ranges. More...
 
interface  IScan< T >
 Same as IScannable{T} except that it does not implement IEnumerable{T}. In most cases IScannable{T} should be implemented instead. More...
 
interface  IScannable< T >
 A sequence of T objects that is meant to be read in chunks. This interface is essentially a faster version of IEnumerable{T}: it allows the caller to scan a sequence faster by avoiding unnecessary interface calls. More...
 
interface  IScanner< T >
 A data-reading object returned by IScannable{T} implementations. This interface is used for reading data, similar to IEnumerator{T}, but it reads blocks of data instead of single items. This can improve performance by reducing the number of interface calls necessary to scan a collection. More...
 
interface  ISetImm< T >
 An immutable set that supports numerous set operations. More...
 
interface  ISetImm< T, SetT >
 An immutable set of type SetT with elements of type T. More...
 
interface  ISetOperations< in T, in InSetT, out OutSetT >
 Set-combining operations: With, Without, Union, Intersect, Except, Xor. More...
 
interface  ISetOperations< in T, SetT >
 Set-combining operations: With, Without, Union, Intersect, Except, Xor. More...
 
interface  ISetTests< SetT >
 Set testing operations.
 
interface  ISource< out T >
 Combines IReadOnlyCollection{T} with related interfaces ICount and IIsEmpty. More...
 
interface  ISparseList< T >
 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< T >
 A sparse list that supports additional methods including InsertRange(int, ISparseListSource{T}). More...
 
interface  ISparseListSource< T >
 Represents a read-only indexed list in which parts of the index space may be unused or "clear". More...
 
interface  IStack< T >
 Represents a LIFO (last-in-first-out) stack. More...
 
interface  ITryGet< in K, out V >
 Enables access to TryGet extension methods for retrieving items from a collection without risk of exceptions. Unlike IReadOnlyDictionary{K, V}, this interface supports variance (e.g. ITryGet{object, string} can be assigned to ITryGet{string, object}) and it does not throw when the key is null. More...
 
interface  ITryPop< out T >
 Represents a collection that produces a sequence of items, and can return the next item without popping it (the Peek operation). 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< TKey, TValue >
 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
 Core functionality 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< T >
 Helper type returned from LCExt.AsListSource{T}. More...
 
class  ListAsSink< T, List >
 Helps implement extension method ListExt.AsSink{T}(IList{T}). More...
 
struct  ListChangeInfo< T >
 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< T >
 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< T >
 Adapter: a read-only wrapper that implements IList(T) and IListSource(T), returned from LCExt.AsList{T}. More...
 
class  ListSourceAsSparse< T >
 Adapter from IListSource{T} to ISparseListSource{T}. More...
 
class  ListSourceDebugView< T >
 This helper class gives a nice view of a custom collection within the debugger. More...
 
class  ListWithChangeEvents< T >
 A list wrapper that provides ListChanging and ListChanged events. Shorthand for Loyc.Collections.Impl.ListWithChangeEvents{T,IList{T}}. More...
 
class  Map< K, V >
 An immutable dictionary. More...
 
class  MapOrMMap< K, V >
 Common base class that contains code shared between Map{K,V} and MMap{K,V}. More...
 
class  MaxHeap< T >
 This is a max-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. The ToMaxHeap extension method returns this type. More...
 
class  MaxHeap< T, TList, TComparer >
 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< T >
 This priority queue wrapper type is returned from the AsMaxHeap() extension method. More...
 
struct  MemoryComparer< T >
 
class  MinHeap< T >
 This is 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. The ToMinHeap extension method returns this type. More...
 
class  MinHeap< T, TList, TComparer >
 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< T >
 This priority queue wrapper type is returned from the AsMinHeap() extension method. More...
 
class  MMap< K, V >
 A dictionary class built on top of InternalSet<KeyValuePair<K,V>>. More...
 
class  MSet< T >
 A mutable set. More...
 
class  MultiMap< K, V >
 A multimap is a dictionary that allows more than one value to be associated with each key. This is much more convenient than a Dictionary of Lists of values, because the indexer always returns a collection (empty if there are no values associated with a key) and its methods automatically create or destroy, as appropriate, the list associated with each key. More...
 
struct  NegList< T >
 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< T >
 Adapter: a random-access range for a slice of an INegListSource{T}. More...
 
struct  NegListSource< T >
 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< Frame, T >
 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< Frame, T >
 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< Num, Math >
 Represents a range of integers of a specified data type. More...
 
struct  RangeEnumerator< R, T >
 Helper struct: enumerates through a forward range (IFRange{T}), calling the range methods through R instead of through IFRange{T}. More...
 
struct  RangeEnumerator< T >
 Helper struct: enumerates through a forward range (IFRange{T}). More...
 
class  RangeExt
 Extension/helper methods for ranges. More...
 
struct  ReadOnlyArraySlice< T >
 
class  ReadOnlyAsCollection< T >
 A read-only wrapper that implements ICollection(T) and ISource(T), returned from LCExt.AsCollection{T} More...
 
class  ReadOnlyListAsListSource< T >
 Helper type returned from LCExt.AsListSource{T}(IReadOnlyList{T}). More...
 
struct  Repeated< T >
 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< T >
 Adapter: a IBinumerator{T} that swaps the MoveNext() and MovePrev() methods. More...
 
struct  ReverseComparer< T >
 Reverses the order used by an IComparer object. More...
 
struct  ReverseComparer< T, TComparer >
 Reverses the order used by an IComparer object. More...
 
struct  ReversedList< T >
 Adapter: a reversed of an IList{T}. TODO: unit tests. More...
 
class  ReversedListSource< T >
 Adapter: reversed view of IListSource{T} returned from LinqToLists.Reverse{T}. More...
 
struct  ROLSlice< T, TList >
 Adapter: a random-access range for a slice of an IReadOnlyList{T}. More...
 
struct  ScannableEnumerable< T >
 An adapter that implements IScannable{T} on any collection. More...
 
class  SelectCollection< ListT, T, TResult >
 Helper class for LinqToLists. More...
 
class  SelectDictionaryFromKeys< K, V >
 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< ListT, T, TResult >
 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< ListT, T, TResult >
 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< ListT, T, TResult >
 Helper class for LinqToLists. More...
 
class  SelectReadOnlyList< ListT, T, TResult >
 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< T >
 An immutable set. More...
 
class  SimpleCache< T >
 A cache designed to save memory by sharing instances of identical strings and other immutable objects. More...
 
class  SimpleCacheTests
 
struct  Slice_< T >
 Adapter: a random-access range for a slice of an IListSource{T}. More...
 
class  SparseAList< T >
 A sparse A-List that implements ISparseList{T}. More...
 
struct  SparseListSourceSlice< T, TList >
 
class  TryGetExt
 Standard extension methods for ITryGet{K, V}. More...
 
class  TypeDictionaryWithBaseTypeLookups< Value >
 A dictionary whose keys are Type objects. This dictionary behaves almost identically to a standard dictionary, except that the TryGetValue method will find matches on base types and interfaces, e.g. if you add a dictionary entry for IEnumerable, then TryGetValue(typeof(BitArray), out _) will return true. More...
 
class  UpCastListSource< T, TOut >
 Helper class for treating a collection of a derived type as a collection of a base type or interface. More...
 
class  UpCastSource< T, TOut >
 Helper class for treating a collection of a derived type as a collection of a base type or interface. More...
 
class  ValueCollection< TKey, TValue >
 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< T >
 VList represents a reference to a reverse-order FVList. More...
 
class  VListBlock< T >
 VListBlock implements the core functionality of FVList, VList, FWList and WList. It is not intended to be used directly. More...
 
class  VListBlockArray< T >
 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< T >
 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< T >
 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< TKey, TValue >
 A dictionary with weak keys. More...
 
class  WeakKeyReference< T >
 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< K, V >
 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< T >
 WList is the mutable variant of the VList data structure. More...
 
class  WListBase< T >
 Shared base class of FWList and WList. More...
 
class  WListProtected< T >
 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 > info)
 Represents the method that handles the INotifyListChanging{T, TSender}.ListChanging event. More...
 
delegate void ListChangingHandler< T > (IListSource< T > sender, ListChangeInfo< T > info)
 
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

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.

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.

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

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

Represents the method that handles the INotifyListChanging{T, TSender}.ListChanging event.

Parameters
senderThe collection that changed.
argsInformation about the change.
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.