Documentation ¶
Index ¶
- type Counter
- func FromSlice[A comparable](elems []*base.Pair[A, int]) *Counter[A]
- func FromSliceBy[A any, K comparable](projection func(A) K, elems []*base.Pair[A, int]) *Counter[A]
- func NewCounter[A comparable](elems iterable.Iterable[*base.Pair[A, int]]) *Counter[A]
- func NewCounterBy[A any, K comparable](projection func(A) K, initialElements iterable.Iterable[*base.Pair[A, int]]) *Counter[A]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter[A any] struct { AddN func(A, int) int RemoveN func(A, int) int Get func(A) int Len func() int ToSlice func() []*base.Pair[A, int] Union func(*Counter[A]) *Counter[A] Intersect func(*Counter[A]) *Counter[A] Difference func(*Counter[A]) *Counter[A] Iterator func() iterable.Iterator[*base.Pair[A, int]] KeysIterator func() iterable.Iterator[A] CountsIterator func() iterable.Iterator[int] }
func FromSlice ¶ added in v0.2.3
func FromSlice[A comparable](elems []*base.Pair[A, int]) *Counter[A]
func FromSliceBy ¶ added in v0.2.3
func NewCounter ¶
func NewCounterBy ¶ added in v0.2.3
Click to show internal directories.
Click to hide internal directories.