Documentation ¶
Index ¶
- type IList
- type List
- func (list *List) Add(items ...interface{})
- func (list *List) AddConf(cond func(index int, item interface{}) bool, items ...interface{})
- func (list *List) At(index int) (result interface{})
- func (list *List) Clear()
- func (list *List) Clone() *List
- func (list *List) Contains(item interface{}) bool
- func (list *List) ContainsCond(cond func(index int, item interface{}) bool) bool
- func (list *List) CountCond(cond func(index int, item interface{}) bool) int
- func (list *List) Dispose()
- func (list *List) Every(cond func(index int, item interface{}) bool) bool
- func (list *List) Filter(cond func(index int, item interface{}) bool) *List
- func (list *List) First(cond func(index int, item interface{}) bool) (val interface{}, has bool)
- func (list *List) ForRange(handler func(index int, item interface{}) error)
- func (list *List) ForRangeFromLast(handler func(index int, item interface{}) error)
- func (list *List) GroupByCount(count int) (r []*List)
- func (list *List) GroupByCustomKey(getKey func(item interface{}) string) map[string]*List
- func (list *List) IndexOf(item interface{}) int
- func (list *List) IndexOfConf(cond func(index int, item interface{}) bool) int
- func (list *List) Insert(i int, item interface{})
- func (list *List) Last(cond func(index int, item interface{}) bool) (result interface{}, has bool)
- func (list *List) Length() int
- func (list *List) Pop() interface{}
- func (list *List) Push(item interface{})
- func (list *List) PushList(val IList)
- func (list *List) Remove(item interface{})
- func (list *List) RemoveAt(i int)
- func (list *List) Replace(i int, item interface{})
- func (list *List) Reverse()
- func (list *List) Self() *List
- func (list *List) Set(index int, val interface{})
- func (list *List) SetList(val []interface{})
- func (list *List) Shift() interface{}
- func (list *List) Slice() []interface{}
- func (list *List) Sort(compare func(a, b interface{}) int)
- func (list *List) Union(a IList) *List
- func (list *List) UnionByCustomKey(a IList, getKey func(item interface{}) string) *List
- func (list *List) Unique() *List
- func (list *List) UniqueByCustomKey(getKey func(item interface{}) string) *List
- func (list *List) Unshift(item interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IList ¶
type IList interface { Add(items ...interface{}) AddConf(cond func(index int, item interface{}) bool, items ...interface{}) Set(index int, val interface{}) SetList(val []interface{}) At(index int) interface{} Clear() Dispose() Clone() *List Contains(item interface{}) bool ContainsCond(cond func(index int, item interface{}) bool) bool CountCond(cond func(index int, item interface{}) bool) int Every(cond func(index int, item interface{}) bool) bool First(cond func(index int, item interface{}) bool) (val interface{}, has bool) Filter(cond func(index int, item interface{}) bool) *List ForRange(handler func(index int, item interface{}) error) IndexOfConf(cond func(index int, item interface{}) bool) int IndexOf(item interface{}) int Last(cond func(index int, item interface{}) bool) (val interface{}, has bool) Length() int Pop() interface{} Push(item interface{}) PushList(val IList) Remove(item interface{}) RemoveAt(i int) Replace(i int, item interface{}) Reverse() Shift() interface{} Slice() []interface{} Self() *List Sort(compare func(a, b interface{}) int) Unshift(item interface{}) Unique() *List UniqueByCustomKey(getKey func(item interface{}) string) *List Union(a IList) *List UnionByCustomKey(a IList, getKey func(a interface{}) string) *List GroupByCount(count int) (r []*List) GroupByCustomKey(getKey func(item interface{}) string) map[string]*List }
type List ¶
type List struct {
// contains filtered or unexported fields
}
func (*List) ContainsCond ¶
func (*List) ForRangeFromLast ¶
从最后往前开始遍历 如果返回错误,迭代终止
func (*List) GroupByCount ¶
GroupByCount 按指定数量分组
func (*List) GroupByCustomKey ¶
func (*List) IndexOfConf ¶
返回符合条件的项的索引
func (*List) UnionByCustomKey ¶
UnionByCustomKey 并集
func (*List) UniqueByCustomKey ¶
UniqueByCustomKey 去重操作, 返回去重后的数组 自定义键值
Click to show internal directories.
Click to hide internal directories.