glist

package
v0.0.0-...-c9a36a8 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

并发安全的双向链表.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type List

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

变长双向链表

func New

func New() *List

获得一个变长链表指针

func (*List) Back

func (this *List) Back() *list.Element

获取表位指针

func (*List) BackAll

func (this *List) BackAll() []interface{}

从链表尾获取所有数据(不删除)

func (*List) BackItem

func (this *List) BackItem() interface{}

获取链表尾值(不删除)

func (*List) BatchPopBack

func (this *List) BatchPopBack(max int) []interface{}

批量从链表尾端出栈数据项(删除)

func (*List) BatchPopFront

func (this *List) BatchPopFront(max int) []interface{}

批量从链表头端出栈数据项(删除)

func (*List) BatchPushFront

func (this *List) BatchPushFront(vs []interface{})

批量往链表头入栈数据项

func (*List) Front

func (this *List) Front() *list.Element

获取表头指针

func (*List) FrontAll

func (this *List) FrontAll() []interface{}

从链表头获取所有数据(不删除)

func (*List) FrontItem

func (this *List) FrontItem() interface{}

获取链表头值(不删除)

func (*List) InsertAfter

func (this *List) InsertAfter(v interface{}, mark *list.Element) *list.Element

在list 中元素mark之后插入一个值为v的元素,并返回该元素,如果mark不是list中元素,则list不改变。

func (*List) InsertBefore

func (this *List) InsertBefore(v interface{}, mark *list.Element) *list.Element

在list 中元素mark之前插入一个值为v的元素,并返回该元素,如果mark不是list中元素,则list不改变。

func (*List) Len

func (this *List) Len() int

获取链表长度

func (*List) PopBack

func (this *List) PopBack() interface{}

从链表尾端出栈数据项(删除)

func (*List) PopBackAll

func (this *List) PopBackAll() []interface{}

批量从链表尾端依次获取所有数据(删除)

func (*List) PopFront

func (this *List) PopFront() interface{}

从链表头端出栈数据项(删除)

func (*List) PopFrontAll

func (this *List) PopFrontAll() []interface{}

批量从链表头端依次获取所有数据(删除)

func (*List) PushBack

func (this *List) PushBack(v interface{}) *list.Element

往链表尾入栈数据项

func (*List) PushFront

func (this *List) PushFront(v interface{}) *list.Element

往链表头入栈数据项

func (*List) Remove

func (this *List) Remove(e *list.Element) interface{}

删除数据项

func (*List) RemoveAll

func (this *List) RemoveAll()

删除所有数据项

Jump to

Keyboard shortcuts

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