Documentation ¶
Index ¶
- Variables
- func Run(c RunCall, lock sync.Locker, qu Queue)
- type Circular
- func (cr *Circular) Add(it interface{}) error
- func (cr *Circular) Empty() bool
- func (cr *Circular) Find(fn IndexFunc) (interface{}, int)
- func (cr *Circular) Len() int
- func (cr *Circular) Next(index int) (interface{}, int)
- func (cr *Circular) Peek() interface{}
- func (cr *Circular) Pop() interface{}
- func (cr *Circular) Reset()
- type IPriority
- type IndexFunc
- type LQueue
- func (lq *LQueue) Add(val interface{}) error
- func (lq *LQueue) AddTail(val interface{}) error
- func (lq *LQueue) Cap() int
- func (lq *LQueue) Empty() bool
- func (lq *LQueue) Find(fn IndexFunc) (interface{}, int)
- func (lq *LQueue) Len() int
- func (lq *LQueue) Peek() interface{}
- func (lq *LQueue) Pop() interface{}
- func (lq *LQueue) ToList() []interface{}
- type Node
- type PQueue
- func (pq *PQueue) Add(elem interface{}) error
- func (pq *PQueue) Empty() bool
- func (pq *PQueue) Find(fn IndexFunc) (interface{}, int)
- func (pq *PQueue) Head() IPriority
- func (pq PQueue) Len() int
- func (pq PQueue) Less(i, j int) bool
- func (pq *PQueue) Peek() interface{}
- func (pq *PQueue) Pop() interface{}
- func (pq *PQueue) Push(x interface{})
- func (pq *PQueue) Remove(i int) interface{}
- func (pq PQueue) Swap(i, j int)
- type PriorityItem
- type Queue
- type ResetFunc
- type RunCall
- type SQueue
- func (sq *SQueue) Add(elem interface{}) error
- func (sq *SQueue) Empty() bool
- func (sq *SQueue) Find(fn IndexFunc) (interface{}, int)
- func (sq *SQueue) Get(index int) interface{}
- func (sq *SQueue) Len() int
- func (sq *SQueue) Less(i, j int) bool
- func (sq *SQueue) Peek() interface{}
- func (sq *SQueue) Pop() interface{}
- func (sq *SQueue) Push(elem interface{})
- func (sq *SQueue) Swap(i, j int)
- func (sq *SQueue) ToList() []interface{}
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIsFull = errors.New("is full")
View Source
var ErrIsReleased = errors.New("size is zero")
View Source
var PriorityType = reflect.TypeOf((*IPriority)(nil)).Elem()
Functions ¶
Types ¶
type Circular ¶
type Circular struct {
// contains filtered or unexported fields
}
Circular 环型队列
func NewCircular ¶
type IPriority ¶ added in v1.3.58
type IPriority interface { GValue() interface{} PValue() int64 //优先级值,越小越前 }
func NewPriorityItem ¶ added in v1.3.58
func NewPriorityItem(elem interface{}) IPriority
type LQueue ¶
type LQueue struct {
// contains filtered or unexported fields
}
LQueue 链表式队列
type PQueue ¶
type PQueue []IPriority
PQueue 优先级
func (*PQueue) Pop ¶
func (pq *PQueue) Pop() interface{}
Pop implements the heap.Interface.Pop. Removes and returns element Len() - 1.
func (*PQueue) Push ¶
func (pq *PQueue) Push(x interface{})
Push implements the heap.Interface.Push. Adds x as element Len().
type PriorityItem ¶
type PriorityItem struct { Value interface{} Priority int64 }
PriorityItem 优先级
func (*PriorityItem) GValue ¶
func (it *PriorityItem) GValue() interface{}
func (*PriorityItem) PValue ¶
func (it *PriorityItem) PValue() int64
type SQueue ¶
type SQueue struct {
// contains filtered or unexported fields
}
SQueue 固定长度的队列
func (*SQueue) Push ¶
func (sq *SQueue) Push(elem interface{})
Push implements the heap.Interface.Push. Adds x as element Len().
Click to show internal directories.
Click to hide internal directories.