glist

package
v1.5.17 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package glist provides a concurrent-safe(alternative) doubly linked list.

并发安全双向链表.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element = list.Element

type List

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

变长双向链表

func New

func New(unsafe ...bool) *List

获得一个变长链表指针

func (*List) Back

func (l *List) Back() (e *Element)

获取表位指针

func (*List) BackAll

func (l *List) BackAll() (values []interface{})

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

func (*List) BackItem added in v1.5.0

func (l *List) BackItem() (value interface{})

获取链表尾值(不删除)

func (*List) BatchPopBack added in v1.5.0

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

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

func (*List) BatchPopFront added in v1.5.0

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

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

func (*List) BatchPushBack added in v1.5.0

func (l *List) BatchPushBack(values []interface{})

批量往链表尾入栈数据项

func (*List) BatchPushFront added in v1.5.0

func (l *List) BatchPushFront(values []interface{})

批量往链表头入栈数据项

func (*List) BatchRemove added in v1.5.0

func (l *List) BatchRemove(es []*Element)

批量删除数据项

func (*List) Front

func (l *List) Front() (e *Element)

获取表头指针

func (*List) FrontAll

func (l *List) FrontAll() (values []interface{})

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

func (*List) FrontItem added in v1.5.0

func (l *List) FrontItem() (value interface{})

获取链表头值(不删除)

func (*List) InsertAfter

func (l *List) InsertAfter(v interface{}, p *Element) (e *Element)

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

func (*List) InsertBefore

func (l *List) InsertBefore(v interface{}, p *Element) (e *Element)

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

func (*List) Len

func (l *List) Len() (length int)

获取链表长度

func (*List) LockFunc

func (l *List) LockFunc(f func(list *list.List))

写锁操作

func (*List) MoveAfter

func (l *List) MoveAfter(e, p *Element)

func (*List) MoveBefore

func (l *List) MoveBefore(e, p *Element)

func (*List) MoveToBack

func (l *List) MoveToBack(e *Element)

func (*List) MoveToFront

func (l *List) MoveToFront(e *Element)

func (*List) PopBack

func (l *List) PopBack() (value interface{})

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

func (*List) PopBackAll

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

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

func (*List) PopFront

func (l *List) PopFront() (value interface{})

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

func (*List) PopFrontAll

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

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

func (*List) PushBack

func (l *List) PushBack(v interface{}) (e *Element)

往链表尾入栈数据项

func (*List) PushBackList

func (l *List) PushBackList(other *List)

func (*List) PushFront

func (l *List) PushFront(v interface{}) (e *Element)

往链表头入栈数据项

func (*List) PushFrontList

func (l *List) PushFrontList(other *List)

func (*List) RLockFunc

func (l *List) RLockFunc(f func(list *list.List))

读锁操作

func (*List) Remove

func (l *List) Remove(e *Element) (value interface{})

删除数据项e, 并返回删除项的元素项

func (*List) RemoveAll

func (l *List) RemoveAll()

删除所有数据项

Jump to

Keyboard shortcuts

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