Documentation ¶
Index ¶
- type Vector
- func (c *Vector[T]) Back() T
- func (c *Vector[T]) Cap() int
- func (c *Vector[T]) Clone() *Vector[T]
- func (c *Vector[T]) Delete(index int)
- func (c *Vector[T]) Elem() []T
- func (c *Vector[T]) Filter(f func(i int, v T) bool) *Vector[T]
- func (c *Vector[T]) Front() T
- func (c *Vector[T]) Get(index int) T
- func (c *Vector[T]) GroupByInt(transfer func(i int, v T) int) map[int][]T
- func (c *Vector[T]) GroupByInt64(transfer func(i int, v T) int64) map[int64][]T
- func (c *Vector[T]) GroupByString(transfer func(i int, v T) string) map[string][]T
- func (c *Vector[T]) Len() int
- func (c *Vector[T]) MapInt(transfer func(i int, v T) int) *Vector[int]
- func (c *Vector[T]) MapInt64(transfer func(i int, v T) int64) *Vector[int64]
- func (c *Vector[T]) MapString(transfer func(i int, v T) string) *Vector[string]
- func (c *Vector[T]) PopBack() (value T)
- func (c *Vector[T]) PopFront() (value T)
- func (c *Vector[T]) PushBack(v T)
- func (c *Vector[T]) PushFront(v T)
- func (c *Vector[T]) Range(f func(i int, v T) bool)
- func (c *Vector[T]) Reset()
- func (c *Vector[T]) Reverse() *Vector[T]
- func (c *Vector[T]) Slice(start, end int) *Vector[T]
- func (c *Vector[T]) SortByInt(transfer func(v T) int) *Vector[T]
- func (c *Vector[T]) SortByInt64(transfer func(v T) int64) *Vector[T]
- func (c *Vector[T]) SortByString(transfer func(v T) string) *Vector[T]
- func (c *Vector[T]) ToInt64Map(transfer func(v T) int64) map[int64]T
- func (c *Vector[T]) ToIntMap(transfer func(v T) int) map[int]T
- func (c *Vector[T]) ToStringMap(transfer func(v T) string) map[string]T
- func (c *Vector[T]) UniqueByInt(transfer func(v T) int) *Vector[T]
- func (c *Vector[T]) UniqueByInt64(transfer func(v T) int64) *Vector[T]
- func (c *Vector[T]) UniqueByString(transfer func(v T) string) *Vector[T]
- func (c *Vector[T]) Update(index int, value T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Vector ¶
type Vector[T any] []T
Vector 动态数组
func NewFromDocs ¶ added in v1.1.2
NewFromDocs 从可变参数创建动态数组
func (*Vector[T]) GroupByInt ¶ added in v1.1.7
GroupByInt 通过int类型字段分组
func (*Vector[T]) GroupByInt64 ¶ added in v1.1.7
GroupByInt64 通过int64类型字段分组
func (*Vector[T]) GroupByString ¶ added in v1.1.7
GroupByString 通过string类型字段分组
func (*Vector[T]) PopFront ¶ added in v1.1.2
func (c *Vector[T]) PopFront() (value T)
PopFront 从头部弹出元素
func (*Vector[T]) PushFront ¶ added in v1.1.5
func (c *Vector[T]) PushFront(v T)
PushFront 向头部追加元素 性能不好, 少用
func (*Vector[T]) SortByInt64 ¶ added in v1.1.8
func (*Vector[T]) SortByString ¶ added in v1.1.8
func (*Vector[T]) ToInt64Map ¶ added in v1.1.8
ToInt64Map 转换为map
func (*Vector[T]) ToStringMap ¶ added in v1.1.8
ToStringMap 转换为map
func (*Vector[T]) UniqueByInt ¶ added in v1.1.5
UniqueByInt 通过int类型字段去重
func (*Vector[T]) UniqueByInt64 ¶ added in v1.1.5
UniqueByInt64 通过int64类型字段去重
func (*Vector[T]) UniqueByString ¶ added in v1.1.5
UniqueByString 通过string类型字段去重
Click to show internal directories.
Click to hide internal directories.