Import std.collections.counter
std.collections.counter
Counter<T>: how many times each value was added, in the order the values were added. A value's
count is never 0: one whose count goes down to 0 goes, so it comes back last, and counter[value]
of one that isn't there is 0.
std/collections/counter.fb
Types
Counter
class
@DebugEntries Public Class Counter<T: Hashable> Implements Iterable<(T, Int)>, Cloneable, Defaultable, Hashable
How many times each value was added, for tallies and histograms.
std/collections/counter.fb, line 10
-
A new, empty Counter.
-
How many values it counts, each once.
-
All the counts added up, which can be more than an Int holds.
-
Counts the
valueonce more. -
Counts the
valuetimesmore times. A negativetimespanics, and so does a count past what an Int holds, which only Total can be. -
Counts each of the
valuesonce more, all read first. -
Counts the
valueonce less, and tells whether it was there. -
Counts the
valueup totimesless, and gives how many it took away. A negativetimespanics. -
How many times the value was counted, or 0.
-
Gives the value a count, and a count of 0 removes it. A negative count panics.
-
Whether
valuehas a count. -
Takes every count out.
-
The
countmost counted values and their counts, most first, and values counted the same number of times in the Counter's order. A negativecountpanics. -
The values, each once, in the order they were added, one that came back last.
-
A new, empty Counter.
-
A new Counter with the same counts.
-
Two Counters are equal when they count the same values the same number of times, in any order.
-
Its hash, the same for values that are equal.
Doc from
std.core.interfaces.Hashable.Hash. -
Each value and its count, for 'For value, count In counter'. Changing a count while going over them is fine, but adding or removing a value panics.
Extends
Counter
extend
Extend Counter<T> Implements Printable
No doc comment.
std/collections/counter.fb, line 143
-
Its text, as a string interpolation like "{value}" shows it.
Doc from
std.core.interfaces.Printable.ToString.
Report an issue with this page or with FutureBlitz on GitHub.