array

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(value interface{})

func Get

func Get(index int) interface{}

func GetFloat64

func GetFloat64(index int) float64

func GetInt

func GetInt(index int) int

func GetString

func GetString(index int) string

func Index

func Index(value interface{}) int

func Len

func Len() int

func RemoveFast

func RemoveFast(index int)

此移除方法会改变数据的顺序,如对顺序有要求,请使用RemoveSlow

func RemoveFastByValue

func RemoveFastByValue(value interface{}) error

func RemoveSlow

func RemoveSlow(index int)

此移除方法需要拷贝数据元素,性能相对会慢一些。但不会更改顺序

Types

type Array

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

func New

func New() *Array

func (*Array) Add

func (a *Array) Add(value interface{})

func (*Array) Get

func (a *Array) Get(index int) interface{}

func (*Array) GetFloat64

func (a *Array) GetFloat64(index int) float64

func (*Array) GetInt

func (a *Array) GetInt(index int) int

func (*Array) GetString

func (a *Array) GetString(index int) string

func (*Array) Index

func (a *Array) Index(value interface{}) int

func (*Array) Len

func (a *Array) Len() int

func (*Array) RemoveFast

func (a *Array) RemoveFast(index int)

此移除方法会改变数据的顺序,如对顺序有要求,请使用RemoveSlow

func (*Array) RemoveFastByValue

func (a *Array) RemoveFastByValue(value interface{}) error

func (*Array) RemoveSlow

func (a *Array) RemoveSlow(index int)

此移除方法需要拷贝数据元素,性能相对会慢一些。但不会更改顺序

Jump to

Keyboard shortcuts

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