Documentation
¶
Index ¶
- type Queue
- func (q *Queue[ITEM]) Dequeue() (ITEM, error)
- func (q *Queue[ITEM]) Enqueue(item ITEM) error
- func (q *Queue[ITEM]) Front() (ITEM, error)
- func (q *Queue[ITEM]) IsEmpty() bool
- func (q *Queue[ITEM]) IsFull() bool
- func (q *Queue[ITEM]) Items() []ITEM
- func (q *Queue[ITEM]) WithMax(max int) QueueInterface[ITEM]
- type QueueInterface
- type Set
- func (s *Set[E]) Add(values ...E)
- func (s *Set[E]) Clear()
- func (s *Set[E]) Del(values ...E)
- func (s *Set[E]) DelIf(condition func(value E) bool) SetInterface[E]
- func (s *Set[E]) Filter(condition func(value E) bool) SetInterface[E]
- func (s *Set[E]) IsEmpty() bool
- func (s *Set[E]) IsExists(value E) bool
- func (s *Set[E]) Size() int
- func (s *Set[E]) Slice() []E
- type SetInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[ITEM any] struct { // contains filtered or unexported fields }
func (*Queue[ITEM]) WithMax ¶
func (q *Queue[ITEM]) WithMax(max int) QueueInterface[ITEM]
WithMax implements QueueInterface.
type QueueInterface ¶
type QueueInterface[ITEM any] interface { WithMax(max int) QueueInterface[ITEM] Enqueue(item ITEM) error Dequeue() (ITEM, error) IsEmpty() bool IsFull() bool Front() (ITEM, error) Items() []ITEM }
func NewQueue ¶
func NewQueue[ITEM any]() QueueInterface[ITEM]
type Set ¶
type Set[E comparable] struct { // contains filtered or unexported fields }
func (*Set[E]) DelIf ¶
func (s *Set[E]) DelIf(condition func(value E) bool) SetInterface[E]
func (*Set[E]) Filter ¶ added in v0.0.18
func (s *Set[E]) Filter(condition func(value E) bool) SetInterface[E]
type SetInterface ¶
type SetInterface[E comparable] interface { // Added list element to set. Add(values ...E) // To check is element is exists on set. IsExists(value E) bool // Delete list element of set. Del(values ...E) // Convert set to slice. Maybe you need it for interation. Slice() []E // Clear list element from set. Clear() // Check is set is empty. Return true is empty and false is not empty. IsEmpty() bool // Get size of element on set. Size() int // Delete element from set if condition is matched. DelIf(condition func(value E) bool) SetInterface[E] // Filter elements of set. Will return new set with filtered elements. Filter(condition func(value E) bool) SetInterface[E] }
func NewSet ¶
func NewSet[E comparable](values ...E) SetInterface[E]
Set data type is like `slice` or `array` but without duplicate element and set element is unordered element
Click to show internal directories.
Click to hide internal directories.