queue

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDeque

type IDeque interface {
	GetLength() int
	IsEmpty() bool
	IsFull() bool
	GetAvailableCapacitySize() int
	CheckAvailableCapacity(pushValueLen int) bool

	PushValueToBack(value any) error
	PushValuesToBack(values ...any) error
	PushValueToFront(value any) error
	PushValuesToFront(values ...any) error

	PopValueFromFront() (any, bool)
	PopValuesFromFront(count int) (retValues []any)
	PopValuesFromFrontWithFilterFunction(f func(value interface{}) bool) (retErr error)
	PopValueFromBack() (any, bool)
	PopValuesFromBack(count int) (retValues []any)
	PopValuesFromBackWithFilterFunction(f func(value interface{}) bool) (retErr error)
}

type IRingQueue

type IRingQueue interface {
	GetLength() int
	IsEmpty() bool
	IsFull() bool
	GetAvailableCapacitySize() int
	PushValue(value interface{}) error
	PushValues(values ...interface{}) error
	PopValue() (interface{}, bool)
	PopValues(count int) (retValues []interface{})
	PopValuesToListSpace(ptrListSpace *[]any) (retCount int, retErr error)
	PopValuesWithFilterFunction(f func(value interface{}) bool) (retErr error)
}

type LinkListDeque

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

func NewLinkListDeque

func NewLinkListDeque(capacity int) *LinkListDeque

func (*LinkListDeque) CheckAvailableCapacity

func (t *LinkListDeque) CheckAvailableCapacity(pushValueLen int) bool

func (*LinkListDeque) GetAvailableCapacitySize

func (t *LinkListDeque) GetAvailableCapacitySize() int

func (*LinkListDeque) GetLength

func (t *LinkListDeque) GetLength() int

func (*LinkListDeque) IsEmpty

func (t *LinkListDeque) IsEmpty() bool

func (*LinkListDeque) IsFull

func (t *LinkListDeque) IsFull() bool

func (*LinkListDeque) PopValueFromBack

func (t *LinkListDeque) PopValueFromBack() (any, bool)

func (*LinkListDeque) PopValueFromFront

func (t *LinkListDeque) PopValueFromFront() (any, bool)

func (*LinkListDeque) PopValuesFromBack

func (t *LinkListDeque) PopValuesFromBack(count int) (retValues []any)

func (*LinkListDeque) PopValuesFromBackToListSpace

func (t *LinkListDeque) PopValuesFromBackToListSpace(ptrListSpace *[]any) (retCount int, retErr error)

func (*LinkListDeque) PopValuesFromBackWithFilterFunction added in v1.0.1

func (t *LinkListDeque) PopValuesFromBackWithFilterFunction(f func(value interface{}) bool) (retErr error)

func (*LinkListDeque) PopValuesFromFront

func (t *LinkListDeque) PopValuesFromFront(count int) (retValues []any)

func (*LinkListDeque) PopValuesFromFrontToListSpace

func (t *LinkListDeque) PopValuesFromFrontToListSpace(ptrListSpace *[]any) (retCount int, retErr error)

func (*LinkListDeque) PopValuesFromFrontWithFilterFunction added in v1.0.1

func (t *LinkListDeque) PopValuesFromFrontWithFilterFunction(f func(value interface{}) bool) (retErr error)

func (*LinkListDeque) PushValueToBack

func (t *LinkListDeque) PushValueToBack(value any) error

func (*LinkListDeque) PushValueToFront

func (t *LinkListDeque) PushValueToFront(value any) error

func (*LinkListDeque) PushValuesToBack

func (t *LinkListDeque) PushValuesToBack(values ...any) error

func (*LinkListDeque) PushValuesToBackWithoutCheck

func (t *LinkListDeque) PushValuesToBackWithoutCheck(values ...any) (retPushedCount int)

func (*LinkListDeque) PushValuesToFront

func (t *LinkListDeque) PushValuesToFront(values ...any) error

func (*LinkListDeque) PushValuesToFrontWithoutCheck

func (t *LinkListDeque) PushValuesToFrontWithoutCheck(values ...any) (retPushedCount int)

func (*LinkListDeque) RemoveElements

func (t *LinkListDeque) RemoveElements(elems []*list.Element)

func (*LinkListDeque) ScanElementsFromBack

func (t *LinkListDeque) ScanElementsFromBack(f func(elem *list.Element) bool)

func (*LinkListDeque) ScanElementsFromFront

func (t *LinkListDeque) ScanElementsFromFront(f func(elem *list.Element) bool)

type RingQueue

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

func NewRingQueue

func NewRingQueue(capacity int) *RingQueue

func (*RingQueue) GetAvailableCapacitySize

func (t *RingQueue) GetAvailableCapacitySize() int

func (*RingQueue) GetLength

func (t *RingQueue) GetLength() int

func (*RingQueue) IsEmpty

func (t *RingQueue) IsEmpty() bool

func (*RingQueue) IsFull

func (t *RingQueue) IsFull() bool

func (*RingQueue) PopValue

func (t *RingQueue) PopValue() (interface{}, bool)

func (*RingQueue) PopValues

func (t *RingQueue) PopValues(count int) (retValues []interface{})

func (*RingQueue) PopValuesToListSpace

func (t *RingQueue) PopValuesToListSpace(ptrListSpace *[]any) (retCount int, retErr error)

func (*RingQueue) PopValuesWithFilterFunction added in v1.0.1

func (t *RingQueue) PopValuesWithFilterFunction(f func(value interface{}) bool) (retErr error)

func (*RingQueue) PushValue

func (t *RingQueue) PushValue(value interface{}) error

func (*RingQueue) PushValues

func (t *RingQueue) PushValues(values ...interface{}) error

func (*RingQueue) PushValuesWithoutCheck

func (t *RingQueue) PushValuesWithoutCheck(values ...interface{}) (retPushedCount int)

func (*RingQueue) ScanElements added in v1.0.1

func (t *RingQueue) ScanElements(f func(value interface{}) bool) error

type SafetyDeque

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

func NewSafetyDeque

func NewSafetyDeque(newDequeFunc func() IDeque) (*SafetyDeque, error)

func (*SafetyDeque) CheckAvailableCapacity

func (t *SafetyDeque) CheckAvailableCapacity(pushValueLen int) bool

func (*SafetyDeque) ExecuteReadMethod added in v1.0.2

func (t *SafetyDeque) ExecuteReadMethod(f func())

func (*SafetyDeque) ExecuteWriteMethod added in v1.0.2

func (t *SafetyDeque) ExecuteWriteMethod(f func())

func (*SafetyDeque) GetAvailableCapacitySize

func (t *SafetyDeque) GetAvailableCapacitySize() int

func (*SafetyDeque) GetLength

func (t *SafetyDeque) GetLength() int

func (*SafetyDeque) GetQueueInstance

func (t *SafetyDeque) GetQueueInstance() IDeque

func (*SafetyDeque) IsEmpty

func (t *SafetyDeque) IsEmpty() bool

func (*SafetyDeque) IsFull

func (t *SafetyDeque) IsFull() bool

func (*SafetyDeque) PopValueFromBack

func (t *SafetyDeque) PopValueFromBack() (any, bool)

func (*SafetyDeque) PopValueFromFront

func (t *SafetyDeque) PopValueFromFront() (any, bool)

func (*SafetyDeque) PopValuesFromBack

func (t *SafetyDeque) PopValuesFromBack(count int) (retValues []any)

func (*SafetyDeque) PopValuesFromBackWithFilterFunction added in v1.0.1

func (t *SafetyDeque) PopValuesFromBackWithFilterFunction(f func(value interface{}) bool) (retErr error)

func (*SafetyDeque) PopValuesFromFront

func (t *SafetyDeque) PopValuesFromFront(count int) (retValues []any)

func (*SafetyDeque) PopValuesFromFrontWithFilterFunction added in v1.0.1

func (t *SafetyDeque) PopValuesFromFrontWithFilterFunction(f func(value interface{}) bool) (retErr error)

func (*SafetyDeque) PushValueToBack

func (t *SafetyDeque) PushValueToBack(value any) error

func (*SafetyDeque) PushValueToFront

func (t *SafetyDeque) PushValueToFront(value any) error

func (*SafetyDeque) PushValuesToBack

func (t *SafetyDeque) PushValuesToBack(values ...any) error

func (*SafetyDeque) PushValuesToFront

func (t *SafetyDeque) PushValuesToFront(values ...any) error

type SafetyRingQueue

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

func NewSafetyRingDeque

func NewSafetyRingDeque(newDequeFunc func() IRingQueue) (*SafetyRingQueue, error)

func (*SafetyRingQueue) ExecuteReadMethod added in v1.0.2

func (t *SafetyRingQueue) ExecuteReadMethod(f func())

func (*SafetyRingQueue) ExecuteWriteMethod added in v1.0.2

func (t *SafetyRingQueue) ExecuteWriteMethod(f func())

func (*SafetyRingQueue) GetAvailableCapacitySize

func (t *SafetyRingQueue) GetAvailableCapacitySize() int

func (*SafetyRingQueue) GetLength

func (t *SafetyRingQueue) GetLength() int

func (*SafetyRingQueue) GetQueueInstance

func (t *SafetyRingQueue) GetQueueInstance() IRingQueue

func (*SafetyRingQueue) IsEmpty

func (t *SafetyRingQueue) IsEmpty() bool

func (*SafetyRingQueue) IsFull

func (t *SafetyRingQueue) IsFull() bool

func (*SafetyRingQueue) PopValue

func (t *SafetyRingQueue) PopValue() (interface{}, bool)

func (*SafetyRingQueue) PopValues

func (t *SafetyRingQueue) PopValues(count int) (retValues []interface{})

func (*SafetyRingQueue) PopValuesToListSpace

func (t *SafetyRingQueue) PopValuesToListSpace(ptrListSpace *[]any) (retCount int, retErr error)

func (*SafetyRingQueue) PopValuesWithFilterFunction added in v1.0.1

func (t *SafetyRingQueue) PopValuesWithFilterFunction(f func(value interface{}) bool) (retErr error)

func (*SafetyRingQueue) PushValue

func (t *SafetyRingQueue) PushValue(value interface{}) error

func (*SafetyRingQueue) PushValues

func (t *SafetyRingQueue) PushValues(values ...interface{}) error

Jump to

Keyboard shortcuts

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