gf: github.com/johng-cn/gf/g/container/glist Index | Files

package glist

import "github.com/johng-cn/gf/g/container/glist"

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

并发安全的双向链表.

Index

Package Files

glist.go

type Element Uses

type Element = list.Element

type List Uses

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

变长双向链表

func New Uses

func New(unsafe ...bool) *List

获得一个变长链表指针

func (*List) Back Uses

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

获取表位指针

func (*List) BackAll Uses

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

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

func (*List) BackItem Uses

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

获取链表尾值(不删除)

func (*List) BatchPopBack Uses

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

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

func (*List) BatchPopFront Uses

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

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

func (*List) BatchPushBack Uses

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

批量往链表尾入栈数据项

func (*List) BatchPushFront Uses

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

批量往链表头入栈数据项

func (*List) BatchRemove Uses

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

批量删除数据项

func (*List) Front Uses

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

获取表头指针

func (*List) FrontAll Uses

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

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

func (*List) FrontItem Uses

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

获取链表头值(不删除)

func (*List) InsertAfter Uses

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

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

func (*List) InsertBefore Uses

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

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

func (*List) Len Uses

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

获取链表长度

func (*List) LockFunc Uses

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

写锁操作

func (*List) MoveAfter Uses

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

func (*List) MoveBefore Uses

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

func (*List) MoveToBack Uses

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

func (*List) MoveToFront Uses

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

func (*List) PopBack Uses

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

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

func (*List) PopBackAll Uses

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

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

func (*List) PopFront Uses

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

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

func (*List) PopFrontAll Uses

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

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

func (*List) PushBack Uses

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

往链表尾入栈数据项

func (*List) PushBackList Uses

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

func (*List) PushFront Uses

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

往链表头入栈数据项

func (*List) PushFrontList Uses

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

func (*List) RLockFunc Uses

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

读锁操作

func (*List) Remove Uses

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

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

func (*List) RemoveAll Uses

func (l *List) RemoveAll()

删除所有数据项

Package glist imports 2 packages (graph). Updated 2019-01-17. Refresh now. Tools for package owners.