listx

package
v0.0.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Empty

func Empty(lst *list.List) bool

Empty judge list is empty

@param lst list
@return bool true => empty, false => not empty

func NotEmpty

func NotEmpty(lst *list.List) bool

NotEmpty judge list is not empty

@param lst list
@return bool true => not empty, false => empty

Types

type Any added in v0.0.8

type Any = interface{}

type Arraylist

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

Arraylist array lst

func New

func New(element ...Any) *Arraylist

New create an array list

@param element array element
@return *Arraylist

func (*Arraylist) Add

func (lst *Arraylist) Add(element ...Any)

Add save element to array list

@receiver lst lst
@param element array element

func (*Arraylist) Contains

func (lst *Arraylist) Contains(element Any) (bool, int)

Contains judge array exist element, and return exist result and index

@receiver lst
@param element element
@return bool   exist result
@return int index

func (*Arraylist) Empty

func (lst *Arraylist) Empty() bool

Empty judge array is empty

@receiver lst
@return bool true => empty, false => not empty

func (*Arraylist) Get

func (lst *Arraylist) Get(index int) Any

Get get element from array list at index

@receiver lst
@param index element index
@return Any current result

func (*Arraylist) IndexOf

func (lst *Arraylist) IndexOf(element Any) int

IndexOf index element from array list

@receiver lst
@param element element
@return int current element index

func (*Arraylist) Remove

func (lst *Arraylist) Remove(element Any) bool

Remove delete from array list

@receiver lst
@param element element
@return bool true or false

func (*Arraylist) RemoveAtIndex

func (lst *Arraylist) RemoveAtIndex(index int) Any

RemoveAtIndex from array list at index RemoveAtIndex remove from array list at index

@receiver lst lst
@param index array index
@return any

func (*Arraylist) Size

func (lst *Arraylist) Size() int

Size calc array length

@receiver lst
@return int array length

type Listx

type Listx struct {
	list.List
}

Listx extend from list.List

func (*Listx) Empty

func (lst *Listx) Empty() bool

Empty judge list is empty

@receiver lst list
@return bool true => empty, false => not empty

func (*Listx) ForEach

func (lst *Listx) ForEach(fn func(Any))

ForEach iterates over the list, calling fn on each element.

@receiver lst list
@param fn function

func (*Listx) NotEmpty

func (lst *Listx) NotEmpty() bool

NotEmpty judge list is not empty

@receiver lst list
@return bool true => not empty, false => empty

Jump to

Keyboard shortcuts

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