Documentation
¶
Index ¶
- func Collect[E any, R any](s *Stream[E], collector func(iter.Seq[E]) R) R
- func GroupBy[E any, K comparable](s *Stream[E], classifier func(E) K) map[K][]E
- func ToMap[E any, K comparable, V any](s *Stream[E], mapper func(E) (K, V)) map[K]V
- type MapEntry
- type Stream
- func (s *Stream[E]) Distinct() *Stream[E]
- func (s *Stream[E]) Filter(predicate func(E) bool) *Stream[E]
- func (s *Stream[E]) FindFirst(predicate func(E) bool) *E
- func (s *Stream[E]) Limit(count int) *Stream[E]
- func (s *Stream[E]) Max(less func(E, E) bool) *E
- func (s *Stream[E]) Min(less func(E, E) bool) *E
- func (s *Stream[E]) Peek(action func(E)) *Stream[E]
- func (s *Stream[E]) Skip(n int) *Stream[E]
- func (s *Stream[E]) Sorted(less func(E, E) bool) *Stream[E]
- func (s *Stream[E]) ToSlice() []E
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GroupBy ¶
func GroupBy[E any, K comparable](s *Stream[E], classifier func(E) K) map[K][]E
GroupBy 根据分类器将元素分组
Types ¶
type MapEntry ¶
type MapEntry[K comparable, V any] struct { Key K Value V }
Click to show internal directories.
Click to hide internal directories.