Documentation ¶
Index ¶
- func GroupingBy[T any, K comparable, V any](ts []T, getKey func(t T) K, getVal func(t T) V) map[K][]V
- func GroupingByIdentity[T any, K comparable](ts []T, getKey func(t T) K) map[K][]T
- func ToMap[T any, K comparable, V any](ts []T, getKey func(t T) K, getVal func(t T) V) map[K]V
- func ToMapIdentity[T any, K comparable](ts []T, getKey func(t T) K) map[K]T
- type Number
- type NumberStream
- func (s *NumberStream) AnyMatch(predicate func(t T) bool) bool
- func (s *NumberStream) Count() int
- func (s *NumberStream) Filter(filter func(t T) bool) Stream[T]
- func (s *NumberStream) FindFirst() *T
- func (s *NumberStream) FindFirstOrElse(ele T) T
- func (s *NumberStream) ForEach(action func(t T))
- func (s *NumberStream) ForEachPtr(action func(t *T))
- func (s *NumberStream) GroupingByIdentityIntKey(getKey func(t T) int) map[int][]T
- func (s *NumberStream) GroupingByIdentityLongKey(getKey func(t T) int64) map[int64][]T
- func (s *NumberStream) GroupingByIdentityStrKey(getKey func(t T) string) map[string][]T
- func (s *NumberStream) MapIdentity(convert func(t T) T) Stream[T]
- func (s *NumberStream) MapToDouble(toDoubleFun func(t T) float64) *NumberStream[float64]
- func (s *NumberStream) MapToInt(toIntFun func(t T) int) *NumberStream[int]
- func (s *NumberStream) MapToLong(toLongFun func(t T) int64) *NumberStream[int64]
- func (ns *NumberStream[N]) Max() N
- func (ns *NumberStream[N]) Min() N
- func (s *NumberStream) NoneMatch(predicate func(t T) bool) bool
- func (s *NumberStream) Skip(limit int) Stream[T]
- func (s *NumberStream) SkipIndex(index int, limit int) Stream[T]
- func (ns *NumberStream[N]) Sum() N
- func (s *NumberStream) ToMapIdentityIntKey(getKey func(t T) int) map[int]T
- func (s *NumberStream) ToMapIdentityLongKey(getKey func(t T) int64) map[int64]T
- func (s *NumberStream) ToMapIdentityStrKey(getKey func(t T) string) map[string]T
- func (s *NumberStream) ToMapIntKey(getKey func(t T) int, getVal func(t T) any) map[int]any
- func (s *NumberStream) ToMapLongKey(getKey func(t T) int64, getVal func(t T) any) map[int64]any
- func (s *NumberStream) ToMapStrKey(getKey func(t T) string, getVal func(t T) any) map[string]any
- func (s *NumberStream) ToSlice() []T
- type Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GroupingBy ¶
func GroupingBy[T any, K comparable, V any](ts []T, getKey func(t T) K, getVal func(t T) V) map[K][]V
func GroupingByIdentity ¶
func GroupingByIdentity[T any, K comparable](ts []T, getKey func(t T) K) map[K][]T
func ToMap ¶
func ToMap[T any, K comparable, V any](ts []T, getKey func(t T) K, getVal func(t T) V) map[K]V
func ToMapIdentity ¶
func ToMapIdentity[T any, K comparable](ts []T, getKey func(t T) K) map[K]T
Types ¶
type NumberStream ¶
type NumberStream[N Number] struct { // contains filtered or unexported fields }
func (*NumberStream) FindFirstOrElse ¶
func (s *NumberStream) FindFirstOrElse(ele T) T
func (*NumberStream) ForEachPtr ¶
func (s *NumberStream) ForEachPtr(action func(t *T))
func (*NumberStream) GroupingByIdentityIntKey ¶
func (*NumberStream) GroupingByIdentityLongKey ¶
func (*NumberStream) GroupingByIdentityStrKey ¶
func (*NumberStream) MapIdentity ¶
func (s *NumberStream) MapIdentity(convert func(t T) T) Stream[T]
func (*NumberStream) MapToDouble ¶
func (s *NumberStream) MapToDouble(toDoubleFun func(t T) float64) *NumberStream[float64]
func (*NumberStream) MapToInt ¶
func (s *NumberStream) MapToInt(toIntFun func(t T) int) *NumberStream[int]
func (*NumberStream) MapToLong ¶
func (s *NumberStream) MapToLong(toLongFun func(t T) int64) *NumberStream[int64]
func (*NumberStream[N]) Max ¶
func (ns *NumberStream[N]) Max() N
func (*NumberStream[N]) Min ¶
func (ns *NumberStream[N]) Min() N
func (*NumberStream[N]) Sum ¶
func (ns *NumberStream[N]) Sum() N
func (*NumberStream) ToMapIdentityIntKey ¶
func (*NumberStream) ToMapIdentityLongKey ¶
func (*NumberStream) ToMapIdentityStrKey ¶
func (*NumberStream) ToMapIntKey ¶
func (*NumberStream) ToMapLongKey ¶
func (*NumberStream) ToMapStrKey ¶
type Stream ¶
type Stream[T any] interface { MapIdentity(convert func(t T) T) Stream[T] Filter(filter func(t T) bool) Stream[T] Skip(limit int) Stream[T] SkipIndex(index int, limit int) Stream[T] FindFirst() *T FindFirstOrElse(ele T) T ToSlice() []T ForEach(eachDo func(t T)) ForEachPtr(eachDo func(t *T)) Count() int ToMapStrKey(getKey func(t T) string, getVal func(t T) any) map[string]any ToMapIntKey(getKey func(t T) int, getVal func(t T) any) map[int]any ToMapLongKey(getKey func(t T) int64, getVal func(t T) any) map[int64]any ToMapIdentityStrKey(getKey func(t T) string) map[string]T ToMapIdentityIntKey(getKey func(t T) int) map[int]T ToMapIdentityLongKey(getKey func(t T) int64) map[int64]T GroupingByIdentityStrKey(getKey func(t T) string) map[string][]T GroupingByIdentityIntKey(getKey func(t T) int) map[int][]T GroupingByIdentityLongKey(getKey func(t T) int64) map[int64][]T AnyMatch(predicate func(t T) bool) bool NoneMatch(predicate func(t T) bool) bool MapToInt(toIntFun func(t T) int) *NumberStream[int] MapToLong(toLongFun func(t T) int64) *NumberStream[int64] MapToDouble(toDoubleFun func(t T) float64) *NumberStream[float64] }
Click to show internal directories.
Click to hide internal directories.