queue

package
v2.3.4 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element interface{}

type Iterator

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

func (*Iterator) Next

func (i *Iterator) Next() *Iterator

func (*Iterator) Value

func (i *Iterator) Value() Element

type LinkedQueue

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

func NewLinkedQueue

func NewLinkedQueue() *LinkedQueue

func (*LinkedQueue) Clear

func (queue *LinkedQueue) Clear() bool

func (*LinkedQueue) Exist

func (queue *LinkedQueue) Exist(e Element) bool

func (*LinkedQueue) IsEmpty

func (queue *LinkedQueue) IsEmpty() bool

func (*LinkedQueue) NewIterator

func (queue *LinkedQueue) NewIterator() *Iterator

NewIterator creates a new iterator for the cache.

func (*LinkedQueue) PeekBack

func (queue *LinkedQueue) PeekBack() Element

func (*LinkedQueue) PeekFront

func (queue *LinkedQueue) PeekFront() Element

func (*LinkedQueue) PollBack

func (queue *LinkedQueue) PollBack() Element

func (*LinkedQueue) PollFront

func (queue *LinkedQueue) PollFront() Element

移除队列中最前面的元素

func (*LinkedQueue) PushBack

func (queue *LinkedQueue) PushBack(e Element)

func (*LinkedQueue) PushFront

func (queue *LinkedQueue) PushFront(e Element)

func (*LinkedQueue) Remove

func (queue *LinkedQueue) Remove(e Element) bool

func (*LinkedQueue) Size

func (queue *LinkedQueue) Size() int

type Queue

type Queue interface {
	PushFront(e Element)   // 向队头添加元素
	PushBack(e Element)    // 向队尾添加元素
	PeekFront() Element    // 查看头部的元素
	PeekBack() Element     // 查看尾部的元素
	PollFront() Element    // 移除头部的元素
	PollBack() Element     // 移除尾部的元素
	Remove(e Element) bool // 删除一个值
	Exist(e Element) bool  // 是否存在
	Size() int             // 获取队列的元素个数
	IsEmpty() bool         // 判断队列是否是空
	Clear() bool           // 清空队列
	NewIterator() *Iterator
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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