xarray

package
v1.25.8 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Empty

func Empty[T comparable](array []T) bool

func IndexOf

func IndexOf[T comparable](array []T, value T) int

func Unique added in v1.22.2

func Unique[T comparable](array []T) []T

Types

type Array

type Array[T comparable] struct {
	Values []T
}

func New added in v1.22.6

func New[T comparable](v ...T) *Array[T]

func (*Array[T]) Empty

func (arr *Array[T]) Empty() bool

Empty 判断是否为空数组,这里的空数组指的是数组元素个数为0或元素不为0但是元素的值都是零值的数组

func (*Array[T]) Find

func (arr *Array[T]) Find(f func(val T) bool) (T, bool)

func (*Array[T]) IndexOf

func (arr *Array[T]) IndexOf(value T) int

func (*Array[T]) Join added in v1.20.1

func (arr *Array[T]) Join(sep string) string

func (*Array[T]) Len

func (arr *Array[T]) Len() int

func (*Array[T]) Map

func (arr *Array[T]) Map(f func(val T) (T, bool)) []T

func (*Array[T]) Pop

func (arr *Array[T]) Pop() (T, bool)

func (*Array[T]) Push

func (arr *Array[T]) Push(v T) int

func (*Array[T]) Reverse

func (arr *Array[T]) Reverse()

func (*Array[T]) SetValues

func (arr *Array[T]) SetValues(values []T)

func (*Array[T]) Unique

func (arr *Array[T]) Unique() []T

func (*Array[T]) Value added in v1.20.2

func (arr *Array[T]) Value() []T

Jump to

Keyboard shortcuts

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