Interface IReadOnlyMultiSet<T>
- Namespace
- LfrlAnvil.Collections
- Assembly
- LfrlAnvil.Collections.dll
Represents a generic read-only multi set.
public interface IReadOnlyMultiSet<T> : IReadOnlySet<Pair<T, int>>, IReadOnlyCollection<Pair<T, int>>, IEnumerable<Pair<T, int>>, IEnumerable where T : notnull
Type Parameters
T
Element type.
- Inherited Members
- Extension Methods
Properties
Comparer
Element comparer.
IEqualityComparer<T> Comparer { get; }
Property Value
DistinctItems
Gets all unique elements.
IEnumerable<T> DistinctItems { get; }
Property Value
- IEnumerable<T>
FullCount
Gets the full count of all elements, including repetitions.
long FullCount { get; }
Property Value
Items
Gets all elements, including repetitions.
IEnumerable<T> Items { get; }
Property Value
- IEnumerable<T>
Methods
Contains(T)
Checks whether or not the provided item
exists in this set.
[Pure]
bool Contains(T item)
Parameters
item
TElement to check.
Returns
- bool
true when the provided
item
exists, otherwise false.
Contains(T, int)
Checks whether or not the provided item
exists in this set with a minimum number of repetitions.
[Pure]
bool Contains(T item, int multiplicity)
Parameters
item
TElement to check.
multiplicity
intExpected minimum number of repetitions.
Returns
- bool
true when the provided
item
exists with a minimum number of repetitions, otherwise false.
GetMultiplicity(T)
Returns the number of repetitions associated with the provided item
.
[Pure]
int GetMultiplicity(T item)
Parameters
item
TElement to get the number of repetitions for.
Returns
- int
Number of
item
repetitions.