Occurrence<T extends Object> class
Represents a value and its frequency count within a collection.
Used by mostOccurrences() and leastOccurrences() extension methods
to return both the value and how many times it appears.
Example:
final result = [1, 2, 2, 3].mostOccurrences();
print(result?.value); // 2
print(result?.count); // 2
- Annotations
Constructors
- Occurrence(T value, int count)
-
Creates an Occurrence with the given
valueandcount.const
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override