datastructure

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2020 License: LGPL-3.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

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

func New

func New(n int) *Buffer

func (*Buffer) Get

func (b *Buffer) Get(n int) []interface{}

func (*Buffer) GetOne

func (b *Buffer) GetOne() interface{}

func (*Buffer) Put

func (b *Buffer) Put(v interface{}) interface{}

func (*Buffer) Size

func (b *Buffer) Size() int

func (*Buffer) Slice

func (b *Buffer) Slice(from int, to int) []interface{}

Slice return a slice of buffer s[from: to]

type IndexBuffer

type IndexBuffer struct {
	Buffer
	// contains filtered or unexported fields
}

func NewIndexBuf

func NewIndexBuf(size int) *IndexBuffer

func (*IndexBuffer) Get

func (ib *IndexBuffer) Get(k string) *interface{}

func (*IndexBuffer) Put

func (ib *IndexBuffer) Put(k string, v interface{})

type LimitQueue

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

LimitQueue represents a single instance of the limit queue data structure.

func NewLimitQueue

func NewLimitQueue(len int) *LimitQueue

New constructs and returns a new LimitQueue.

func (*LimitQueue) Add

func (q *LimitQueue) Add(elem interface{})

Add puts an element on the end of the queue.

func (*LimitQueue) Capacity

func (q *LimitQueue) Capacity() int

Length returns the number of elements currently stored in the queue.

func (*LimitQueue) Peek

func (q *LimitQueue) Peek() interface{}

Peek returns the element at the head of the queue. This call panics if the queue is empty.

Jump to

Keyboard shortcuts

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