Documentation ¶
Index ¶
- func AddAt[T comparable](src []T, index int, ele T) []T
- func BatchConsume[T comparable](list []T, batchSize int, consumer func([]T))
- func Contains[T comparable](list []T, ele T) bool
- func ContainsIgnoreCase(slice []string, ele string) bool
- func ContainsIgnoreCaseReturnEle(slice []string, ele string) (bool, string)
- func ConvertEle[T any, R any](ts []T, t2r func(t T) R) []R
- func Distinct[T comparable](list []T) []T
- func Page[T comparable](list []T, subSize int) [][]T
- func Remove[T comparable](src []T, ele T) []T
- func RemoveAt[T comparable](src []T, index int) []T
- type Collection
- type List
- func (self *List[E]) Add(ele E)
- func (self *List[E]) AddAll(eles []E)
- func (self *List[E]) AddAllAt(index int, eles []E)
- func (self *List[E]) AddAt(index int, ele E)
- func (self *List[E]) Contains(ele E) bool
- func (self *List[E]) ForEach(action func(t E))
- func (self *List[E]) Get(index int) E
- func (self *List[E]) IndexOf(ele E) int
- func (self *List[E]) IsEmpty() bool
- func (self *List[E]) LastIndexOf(ele E) int
- func (self *List[E]) Lists(subSize int) [][]E
- func (self *List[E]) Remove(ele E) bool
- func (self *List[E]) RemoveAll(eles []E)
- func (self *List[E]) RemoveAt(index int) bool
- func (self *List[E]) RemoveIf(predicate func(ele E) bool)
- func (self *List[E]) RetainAll(eles []E)
- func (self *List[E]) Size() int
- func (self *List[E]) Stream() streams.Stream[E]
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAt ¶
func AddAt[T comparable](src []T, index int, ele T) []T
func BatchConsume ¶
func BatchConsume[T comparable](list []T, batchSize int, consumer func([]T))
BatchConsume 分批处理,每batchSize一批
func Contains ¶
func Contains[T comparable](list []T, ele T) bool
func ContainsIgnoreCase ¶
func ConvertEle ¶
func Distinct ¶
func Distinct[T comparable](list []T) []T
func Remove ¶
func Remove[T comparable](src []T, ele T) []T
func RemoveAt ¶
func RemoveAt[T comparable](src []T, index int) []T
Types ¶
type Collection ¶
type Collection[E comparable] interface { Add(ele E) Remove(ele E) bool Size() int Contains(ele E) bool IsEmpty() bool }
type List ¶
type List[E comparable] []E
List 切片的别名
func (*List[E]) LastIndexOf ¶
LastIndexOf 返回ele对应切片最后一个元素的索引下标,没有则返回-1
type Set ¶
type Set[E comparable] map[E]struct{}
Click to show internal directories.
Click to hide internal directories.