slicex

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Slicex

type Slicex[T comparable] struct {
	// contains filtered or unexported fields
}

Slicex 线程安全的切片

func New

func New[T comparable]() *Slicex[T]

func (*Slicex[T]) Append

func (sx *Slicex[T]) Append(val T)

func (*Slicex[T]) Clear

func (sx *Slicex[T]) Clear()

func (*Slicex[T]) Data

func (sx *Slicex[T]) Data() []T

func (*Slicex[T]) Get

func (sx *Slicex[T]) Get(beginIndex, count int) []T

func (*Slicex[T]) Len

func (sx *Slicex[T]) Len() int

func (*Slicex[T]) Pop

func (sx *Slicex[T]) Pop(beginIndex, count int) []T

Pop 弹出从beginIndex开始count个元素 desc: 即(取出beginIndex开始count个元素,同时删除取出的元素) IMP: 要么取出count个元素,要么取出0个元素

func (*Slicex[T]) Remove

func (sx *Slicex[T]) Remove(index int)

Jump to

Keyboard shortcuts

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