Counter
A multiset that tracks how many times each element has been added.
Counts are always positive; removing an element down to zero deletes its key, and querying an absent element yields zero. Iteration and toMap follow first-insertion order. mostCommon sorts by count descending and breaks ties by first-insertion order. Backed by LinkedHashMap.
This class is not thread-safe.
Type Parameters
T
the element type.
Functions
Link copied to clipboard
Returns true if at least one element occurs more than once.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Returns true if no element occurs more than once.
Link copied to clipboard
Returns the smallest and largest element as a pair, or null if the receiver is empty.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard