v.io: v.io/x/ref/runtime/internal/lib/deque Index | Files

package deque

import "v.io/x/ref/runtime/internal/lib/deque"

Package deque implements a deque using a circular array.

Index

Package Files

deque.go

type T Uses

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

T is the type of queues.

func (*T) Back Uses

func (q *T) Back() interface{}

Back returns the last element of the deque, or nil if there is none.

func (*T) Clear Uses

func (q *T) Clear()

Clear removes all the elements of the queue.

func (*T) Front Uses

func (q *T) Front() interface{}

Front returns the first element of the deque, or nil if there is none.

func (*T) Iter Uses

func (q *T) Iter(f func(item interface{}) bool)

Iter iterates over the elements of the deque. f should return false to terminate the iteration early.

func (*T) PopBack Uses

func (q *T) PopBack() interface{}

PopBack removes an element from the front of the queue and returns it.

func (*T) PopFront Uses

func (q *T) PopFront() interface{}

PopFront removes an element from the front of the queue and returns it.

func (*T) PushBack Uses

func (q *T) PushBack(item interface{})

PushBack adds an element to the back of the queue.

func (*T) PushFront Uses

func (q *T) PushFront(item interface{})

PushFront adds an element to the front of the deque.

func (*T) Size Uses

func (q *T) Size() int

Size returns the number of items in the queue.

Package deque is imported by 1 packages. Updated 2020-10-24. Refresh now. Tools for package owners.