CondensedCollectionT Class |
[This is preliminary documentation and is subject to change.]
Namespace: Condensed
[SerializableAttribute] public class CondensedCollection<T> : IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable
The CondensedCollectionT type exposes the following members.
Name | Description | |
---|---|---|
CondensedCollectionT |
Initializes a new instance of the CondensedCollectionT class with the
default capacity, default comparer for the type, and no cutover predicate.
| |
CondensedCollectionT(Int32, IEqualityComparerT, PredicateCondensedStats, IEnumerableT) |
Initializes a new instance of the CondensedCollectionT class.
|
Name | Description | |
---|---|---|
Capacity |
Gets or sets the total number of elements the internal data structure can hold without resizing.
| |
Comparer |
Gets the IEqualityComparerT that is used by the CondensedCollectionT
to compare elements while performing deduplication.
| |
Count |
Gets the number of elements in the collection.
| |
CutoverPredicate |
Gets the callback that is periodically called to determine whether it's worthwhile for
this collection to perform deduplication. Called immediately before a new, unique item
is added to the intern pool. Return true
if the condensed list needs to cutover to normal ListT storage.
| |
HasCutover |
Gets whether the collection has stopped performing deduplication
and has internally cutover to normal ListT storage.
| |
IndexType |
Gets the width of the internal index currently used by a CondensedCollectionT.
| |
InternPoolCount |
Gets count of values held internally in the collection's intern pool of unique values,
or -1 if the collection has cutover and is no longer performing deduplication.
| |
IsReadOnly |
Gets a value indicating whether the collection is read-only.
| |
Item |
Gets or sets the element at the specified index.
| |
ReclaimableInternsCount |
Gets count of unused items in the collection's intern pool that
would be freed (made eligible for GC) by a cleanup operation,
or -1 if the collection has cutover and is no longer performing deduplication.
| |
UniqueCount |
Gets count of unique values held in the collection. If T is nullable and null element(s) are present,
null will be counted as a unique value.
|
Name | Description | |
---|---|---|
Add |
Adds an item to the collection.
| |
Cleanup |
Rebuilds the collection's internal data structures, reclaiming unused items and
potentially freeing memory.
| |
Clear |
Removes all items from the collection.
| |
Contains |
Determines whether the collection contains a specific value.
| |
CopyTo |
Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetEnumerator |
Returns an enumerator that iterates through the collection.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IndexOf |
Searches for the specified object and returns the zero-based index of the first occurrence within the collection.
| |
Insert |
Inserts an element into the collection at the specified index.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Remove |
Removes the first occurrence of a specific object from the collection.
| |
RemoveAt |
Removes the item at the specified index.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
InternedValueReclaimable |
Event that is raised when an item in the intern pool of
unique values is no longer stored in the collection.
|
Name | Description | |
---|---|---|
AllTSource |
Determines whether all elements of the collection satisfy a condition. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
AnyTSource |
Determines whether any element of the collection satisfies a condition. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
AverageTSource(FuncTSource, Int32) | Overloaded.
Computes the average of a CondensedCollection of Int32 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
AverageTSource(FuncTSource, NullableInt32) | Overloaded.
Computes the average of a CondensedCollection of nullable Int32 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
AverageTSource(FuncTSource, Decimal) | Overloaded.
Computes the average of a CondensedCollection of Decimal values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
AverageTSource(FuncTSource, NullableDecimal) | Overloaded.
Computes the average of a CondensedCollection of nullable Decimal values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
AverageTSource(FuncTSource, Int64) | Overloaded.
Computes the average of a CondensedCollection of Int64 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
AverageTSource(FuncTSource, NullableInt64) | Overloaded.
Computes the average of a CondensedCollection of nullable Int64 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
AverageTSource(FuncTSource, Double) | Overloaded.
Computes the average of a CondensedCollection of double values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
AverageTSource(FuncTSource, NullableDouble) | Overloaded.
Computes the average of a CondensedCollection of nullable double values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
AverageTSource(FuncTSource, Single) | Overloaded.
Computes the average of a CondensedCollection of float values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
AverageTSource(FuncTSource, NullableSingle) | Overloaded.
Computes the average of a CondensedCollection of nullable float values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
ContainsTSource |
Determines whether a sequence contains a specified value by using a specified comparer.
(Defined by CondensedCollectionExtensions.) | |
CountTSource |
Returns count of elements in the CondensedCollection that satisfy a condition. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
DistinctTSource |
Returns distinct elements from a CondensedCollectionT as determined by the collection's equality comparer.
(Defined by CondensedCollectionExtensions.) | |
FirstTSource |
Returns the first element in a sequence that satisfies a specified condition. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
FirstOrDefaultTSource |
Returns the first element of the sequence that satisfies a condition or a default value if
no such element is found. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
LastTSource |
Returns the last element in a sequence that satisfies a specified condition. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
LastOrDefaultTSource |
Returns the last element of the sequence that satisfies a condition or a default value if
no such element is found. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MaxTSource | Overloaded.
Returns the maximum value in a generic sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MaxTSource(FuncTSource, Int32) | Overloaded.
Computes the maximum value of a CondensedCollection of Int32 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MaxTSource(FuncTSource, NullableInt32) | Overloaded.
Computes the maximum value of a CondensedCollection of nullable Int32 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MaxTSource(FuncTSource, Decimal) | Overloaded.
Computes the maximum value of a CondensedCollection of Decimal values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MaxTSource(FuncTSource, NullableDecimal) | Overloaded.
Computes the maximum value of a CondensedCollection of nullable Decimal values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MaxTSource(FuncTSource, Int64) | Overloaded.
Computes the maximum value of a CondensedCollection of Int64 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MaxTSource(FuncTSource, NullableInt64) | Overloaded.
Computes the maximum value of a CondensedCollection of nullable Int64 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MaxTSource(FuncTSource, Double) | Overloaded.
Computes the maximum value of a CondensedCollection of double values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MaxTSource(FuncTSource, NullableDouble) | Overloaded.
Computes the maximum value of a CondensedCollection of nullable double values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MaxTSource(FuncTSource, Single) | Overloaded.
Computes the maximum value of a CondensedCollection of float values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MaxTSource(FuncTSource, NullableSingle) | Overloaded.
Computes the maximum value of a CondensedCollection of nullable float values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MaxTSource, TResult(FuncTSource, TResult) | Overloaded.
Invokes a transform function on each element of a generic sequence and returns the maximum resulting value. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MinTSource | Overloaded.
Returns the minimum value in a generic sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MinTSource(FuncTSource, Int32) | Overloaded.
Computes the minimum value of a CondensedCollection of Int32 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MinTSource(FuncTSource, NullableInt32) | Overloaded.
Computes the minimum value of a CondensedCollection of nullable Int32 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MinTSource(FuncTSource, Decimal) | Overloaded.
Computes the minimum value of a CondensedCollection of Decimal values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MinTSource(FuncTSource, NullableDecimal) | Overloaded.
Computes the minimum value of a CondensedCollection of nullable Decimal values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MinTSource(FuncTSource, Int64) | Overloaded.
Computes the minimum value of a CondensedCollection of Int64 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MinTSource(FuncTSource, NullableInt64) | Overloaded.
Computes the minimum value of a CondensedCollection of nullable Int64 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MinTSource(FuncTSource, Double) | Overloaded.
Computes the minimum value of a CondensedCollection of double values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MinTSource(FuncTSource, NullableDouble) | Overloaded.
Computes the minimum value of a CondensedCollection of nullable double values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MinTSource(FuncTSource, Single) | Overloaded.
Computes the minimum value of a CondensedCollection of float values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MinTSource(FuncTSource, NullableSingle) | Overloaded.
Computes the minimum value of a CondensedCollection of nullable float values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
MinTSource, TResult(FuncTSource, TResult) | Overloaded.
Invokes a transform function on each element of a generic sequence and returns the minimum resulting value. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
SumTSource(FuncTSource, Int32) | Overloaded.
Computes the sum of a CondensedCollection of Int32 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
SumTSource(FuncTSource, NullableInt32) | Overloaded.
Computes the sum of a CondensedCollection of nullable Int32 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
SumTSource(FuncTSource, Decimal) | Overloaded.
Computes the sum of a CondensedCollection of Decimal values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
SumTSource(FuncTSource, NullableDecimal) | Overloaded.
Computes the sum of a CondensedCollection of nullable Decimal values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
SumTSource(FuncTSource, Int64) | Overloaded.
Computes the sum of a CondensedCollection of Int64 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
SumTSource(FuncTSource, NullableInt64) | Overloaded.
Computes the sum of a CondensedCollection of nullable Int64 values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
SumTSource(FuncTSource, Double) | Overloaded.
Computes the sum of a CondensedCollection of double values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
SumTSource(FuncTSource, NullableDouble) | Overloaded.
Computes the sum of a CondensedCollection of nullable double values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
SumTSource(FuncTSource, Single) | Overloaded.
Computes the sum of a CondensedCollection of float values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) | |
SumTSource(FuncTSource, NullableSingle) | Overloaded.
Computes the sum of a CondensedCollection of nullable float values that are obtained by invoking a transform
function on each element of the input sequence. Optimized for a CondensedCollection.
(Defined by CondensedCollectionExtensions.) |
The CondensedCollection class provides a generalized form of interning for immutable types. It provides the following features:
The CondensedCollection class is best suited for relatively static collection of elements, or, at the very least, a population whose set of unique values is relatively fixed. The collection maintains an "intern pool" of unique values, and this pool is not automatically cleaned up.
CondensedCollection is not thread-safe and does not perform any internal synchronization. Multiple simultaneous readers are allowed, (provided there is no active writer), so a ReaderWriterLockSlim (or an ordinary exclusive lock) should be used to synchronize multi-threaded access to an instance of the collection.