Array

package
v0.0.0-...-adc727d Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

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

func Constructor

func Constructor(capacity int) *Array

构造函数,传入数组的容量capacity构造Array

func (*Array) Add

func (this *Array) Add(index int, e int)

在第 index 个位置插入一个新元素 e

func (*Array) AddFirst

func (this *Array) AddFirst(e int)

向所有元素前添加一个新元素

func (*Array) AddLast

func (this *Array) AddLast(e int)

向所有元素后添加一个新元素

func (*Array) Get

func (this *Array) Get(index int) int

获取 index 索引位置的元素

func (*Array) GetCapacity

func (this *Array) GetCapacity() int

获取数组的容量

func (*Array) GetSize

func (this *Array) GetSize() int

获得数组中的元素个数

func (*Array) IsEmpty

func (this *Array) IsEmpty() bool

返回数组是否为空

func (*Array) Set

func (this *Array) Set(index int, e int)

修改 index 索引位置的元素

func (*Array) String

func (this *Array) String() string

重写 Array 的 string 方法

Jump to

Keyboard shortcuts

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