Documentation ¶
Index ¶
- Variables
- type FuncSorter
- type Stream
- func Floats(args ...float64) (*Stream, error)
- func Gen(genFunc interface{}) (*Stream, error)
- func GenN(num int, genFunc interface{}) (*Stream, error)
- func Ints(args ...int64) (*Stream, error)
- func It(initValue interface{}, itFunc interface{}) (*Stream, error)
- func New(arr interface{}) (*Stream, error)
- func Of(args ...interface{}) (*Stream, error)
- func Strings(args ...string) (*Stream, error)
- func (s *Stream) AllMatch(matchFunc interface{}) bool
- func (s *Stream) AllMatchIndex(matchFunc interface{}) bool
- func (s *Stream) AnyMatch(matchFunc interface{}) bool
- func (s *Stream) AnyMatchIndex(matchFunc interface{}) bool
- func (s *Stream) Call(callFunc interface{}) *Stream
- func (s *Stream) Check(checkFunc interface{}) *Stream
- func (s *Stream) Count() int
- func (s *Stream) Distinct(equalFunc interface{}) *Stream
- func (s *Stream) Exec()
- func (s *Stream) Filter(filterFunc interface{}) *Stream
- func (s *Stream) FilterIndex(filterFunc interface{}) *Stream
- func (s *Stream) First(matchFunc interface{}) interface{}
- func (s *Stream) FlatMap(mapFunc interface{}) *Stream
- func (s *Stream) FlatMapIndex(mapFunc interface{}) *Stream
- func (s *Stream) ForEach(actFunc interface{})
- func (s *Stream) ForEachIndex(actFunc interface{})
- func (s *Stream) Group(groupFunc interface{}) map[interface{}][]interface{}
- func (s *Stream) GroupIndex(groupFunc interface{}) map[interface{}][]interface{}
- func (s *Stream) Last(matchFunc interface{}) interface{}
- func (s *Stream) Limit(num int) *Stream
- func (s *Stream) Map(mapFunc interface{}) *Stream
- func (s *Stream) MapIndex(mapFunc interface{}) *Stream
- func (s *Stream) Max(lessFunc interface{}) interface{}
- func (s *Stream) Min(lessFunc interface{}) interface{}
- func (s *Stream) NoneMatch(matchFunc interface{}) bool
- func (s *Stream) NoneMatchIndex(matchFunc interface{}) bool
- func (s *Stream) Peek(peekFunc interface{}) *Stream
- func (s *Stream) PeekIndex(peekFunc interface{}) *Stream
- func (s *Stream) Reduce(initValue interface{}, reduceFunc interface{}) interface{}
- func (s *Stream) ReduceIndex(initValue interface{}, reduceFunc interface{}) interface{}
- func (s *Stream) Reset() *Stream
- func (s *Stream) Skip(num int) *Stream
- func (s *Stream) Sort(lessFunc interface{}) *Stream
- func (s *Stream) ToSlice(targetSlice interface{}) error
Constants ¶
This section is empty.
Variables ¶
var StrictMode bool
Functions ¶
This section is empty.
Types ¶
type FuncSorter ¶ added in v1.0.1
type FuncSorter struct {
// contains filtered or unexported fields
}
func (*FuncSorter) Len ¶ added in v1.0.1
func (s *FuncSorter) Len() int
func (*FuncSorter) Less ¶ added in v1.0.1
func (s *FuncSorter) Less(i, j int) bool
func (*FuncSorter) Swap ¶ added in v1.0.1
func (s *FuncSorter) Swap(i, j int)
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
func (*Stream) AllMatchIndex ¶ added in v1.0.2
AllMatchIndex operation with index. matchFunc: func(o T, i int) bool
func (*Stream) AnyMatchIndex ¶ added in v1.0.2
AnyMatchIndex operation with index. matchFunc: func(o T, i int) bool
func (*Stream) Check ¶
Check operation. Check if should be continue process data. checkFunc: func(o []T) bool ,checkFunc must return if should be continue process data.
func (*Stream) FilterIndex ¶ added in v1.0.2
FilterIndex operation with index. filterFunc: func(o T, i int) bool
func (*Stream) First ¶
func (s *Stream) First(matchFunc interface{}) interface{}
First operation. matchFunc: func(o T) bool
func (*Stream) FlatMapIndex ¶ added in v1.0.2
FlatMapIndex operation with index. Map one to many mapFunc: func(o T1) []T2
func (*Stream) ForEach ¶
func (s *Stream) ForEach(actFunc interface{})
ForEach executes a provided function once for each array element,and terminate the stream. actFunc: func(o T)
func (*Stream) ForEachIndex ¶ added in v1.0.2
func (s *Stream) ForEachIndex(actFunc interface{})
ForEachIndex executes a provided function once for each array element,and terminate the stream. actFunc: func(o T, i int)
func (*Stream) Group ¶
func (s *Stream) Group(groupFunc interface{}) map[interface{}][]interface{}
Group operation. Group values by key. Parameter groupFunc: func(o T1) (key T2,value T3). Return map[T2][]T3
func (*Stream) GroupIndex ¶ added in v1.0.2
func (s *Stream) GroupIndex(groupFunc interface{}) map[interface{}][]interface{}
GroupIndex operation with index. Group values by key. Parameter groupFunc: func(o T1) (key T2,value T3). Return map[T2][]T3
func (*Stream) Last ¶
func (s *Stream) Last(matchFunc interface{}) interface{}
Last operation. matchFunc: func(o T) bool
func (*Stream) MapIndex ¶ added in v1.0.2
MapIndex operation with index. Map one to one mapFunc: func(o T1, i int) T2
func (*Stream) Max ¶
func (s *Stream) Max(lessFunc interface{}) interface{}
Max operation.lessFunc: func(o1,o2 T) bool
func (*Stream) Min ¶
func (s *Stream) Min(lessFunc interface{}) interface{}
Min operation.lessFunc: func(o1,o2 T) bool
func (*Stream) NoneMatchIndex ¶ added in v1.0.2
NoneMatchIndex operation with index. matchFunc: func(o T) bool
func (*Stream) Reduce ¶
func (s *Stream) Reduce(initValue interface{}, reduceFunc interface{}) interface{}
Reduce operation. reduceFunc: func(r T2,o T) T2
func (*Stream) ReduceIndex ¶ added in v1.0.2
func (s *Stream) ReduceIndex(initValue interface{}, reduceFunc interface{}) interface{}
ReduceIndex operation with index. reduceFunc: func(r T2,o T,i int) T2