stream_utils

package
v0.0.0-...-5750976 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

Stream ...

func Floats

func Floats(args ...float64) (*Stream, error)

Floats create a stream from some floats.

func Gen

func Gen(genFunc interface{}) (*Stream, error)

Gen create a stream by invoke genFunc. genFunc: func() (next T,more bool)

func Ints

func Ints(args ...int64) (*Stream, error)

Ints create a stream from some ints.

func It

func It(initValue interface{}, itFunc interface{}) (*Stream, error)

It create a stream from a iterator.itFunc: func(prev T) (next T,more bool)

func New

func New(arr interface{}) (*Stream, error)

New create a stream from a slice

func Of

func Of(args ...interface{}) (*Stream, error)

Of create a stream from some values

func Strings

func Strings(args ...string) (*Stream, error)

Strings create a stream from some strings.

func (*Stream) AllMatch

func (s *Stream) AllMatch(matchFunc interface{}) bool

AllMatch operation. matchFunc: func(o T) bool

func (*Stream) AnyMatch

func (s *Stream) AnyMatch(matchFunc interface{}) bool

AnyMatch operation. matchFunc: func(o T) bool

func (*Stream) Call

func (s *Stream) Call(callFunc interface{}) *Stream

Call operation. Call function with the data. callFunc: func()

func (*Stream) Check

func (s *Stream) Check(checkFunc interface{}) *Stream

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) Count

func (s *Stream) Count() int

Count operation.Return the count of elements in stream.

func (*Stream) Distinct

func (s *Stream) Distinct(equalFunc interface{}) *Stream

Distinct operation. equalFunc: func(o1,o2 T) bool

func (*Stream) Exec

func (s *Stream) Exec()

Exec operation.

func (*Stream) Filter

func (s *Stream) Filter(filterFunc interface{}) *Stream

Filter operation. filterFunc: func(o T) bool

func (*Stream) First

func (s *Stream) First(matchFunc interface{}) interface{}

First operation. matchFunc: func(o T) bool

func (*Stream) FlatMap

func (s *Stream) FlatMap(mapFunc interface{}) *Stream

FlatMap operation. 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) Group

func (s *Stream) Group(groupFunc interface{}) interface{}

Group operation. Group values by key. Premeter 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) Limit

func (s *Stream) Limit(num int) *Stream

Limit operation.

func (*Stream) Map

func (s *Stream) Map(mapFunc interface{}) *Stream
Map operation. Map one to one

mapFunc: func(o T1) 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) NoneMatch

func (s *Stream) NoneMatch(matchFunc interface{}) bool

NoneMatch operation. matchFunc: func(o T) bool

func (*Stream) Peek

func (s *Stream) Peek(peekFunc interface{}) *Stream

Peek operation. peekFunc: func(o T)

func (*Stream) Reduce

func (s *Stream) Reduce(initValue interface{}, reduceFunc interface{}) interface{}

Reduce operation. reduceFunc: func(r T2,o T) T2

func (*Stream) Reset

func (s *Stream) Reset() *Stream

Reset ...

func (*Stream) Skip

func (s *Stream) Skip(num int) *Stream

Skip operation.

func (*Stream) Sort

func (s *Stream) Sort(lessFunc interface{}) *Stream

Sort operation. lessFunc: func(o1,o2 T) bool

func (*Stream) ToSlice

func (s *Stream) ToSlice(targetSlice interface{}) error

ToSlice operation. targetSlice must be a pointer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL