Enhanced C#
Language of your choice: library documentation
|
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...
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>.
K | Key type of the AListBase |
T | Value type of the AListBase |
TSummary | Type of value that will be derived from the contents of the list(s) |
This class keeps track of a "summary" of each node in each attached AList. It is assumed that there is some way to combine ("aggregate") summaries. For example, one common "summary" is the sum of a list of items, and multiple summaries can be combined simply by adding them.
This class can observe multiple lists at once and combine their results.
Public fields | |
IEnumerable< AListBase< K, T > > | AttachedLists => _roots.Keys |
int | TotalCountInAttachedLists => _roots.Sum(pair => pair.Key.Count) |
TSummary | Summary => GetSummary() |
Public Member Functions | |
TSummary | GetSummary () |
Protected Member Functions | |
abstract TSummary | Summarize (AListLeafBase< K, T > data) |
abstract TSummary | Aggregate (TSummary[] data) |
TSummary | GetSummary (AListNode< K, T > node) |
Protected fields | |
virtual TSummary | EmptyResult => Aggregate(EmptyArray<TSummary>.Value) |