Documentation ¶
Index ¶
- type OrderedSet
- func (s *OrderedSet[T]) Add(v T)
- func (s *OrderedSet[T]) Clear()
- func (s *OrderedSet[T]) Delete(v T) (deleted bool)
- func (s *OrderedSet[T]) ForEach(f func(v T, idx int))
- func (s *OrderedSet[T]) Has(v T) (has bool)
- func (s *OrderedSet[T]) Len() int
- func (s *OrderedSet[T]) Values() iterator.Iterator[T]
- type Set
- type SetLike
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OrderedSet ¶ added in v0.0.9
type OrderedSet[T comparable] struct { // contains filtered or unexported fields }
OrderedSet is same as Set but remembers insertion order.
func NewOrdered ¶ added in v0.0.9
func NewOrdered[T comparable]() *OrderedSet[T]
func (*OrderedSet[T]) Add ¶ added in v0.0.9
func (s *OrderedSet[T]) Add(v T)
func (*OrderedSet[T]) Clear ¶ added in v0.0.9
func (s *OrderedSet[T]) Clear()
func (*OrderedSet[T]) Delete ¶ added in v0.0.9
func (s *OrderedSet[T]) Delete(v T) (deleted bool)
func (*OrderedSet[T]) ForEach ¶ added in v0.0.9
func (s *OrderedSet[T]) ForEach(f func(v T, idx int))
ForEach iterates over set and invoke f with each elements. Order is FIFO. Call of Add with existing v does not change order.
func (*OrderedSet[T]) Has ¶ added in v0.0.9
func (s *OrderedSet[T]) Has(v T) (has bool)
func (*OrderedSet[T]) Len ¶ added in v0.0.9
func (s *OrderedSet[T]) Len() int
func (*OrderedSet[T]) Values ¶ added in v0.0.9
func (s *OrderedSet[T]) Values() iterator.Iterator[T]
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
func New ¶ added in v0.0.9
func New[T comparable]() *Set[T]
Click to show internal directories.
Click to hide internal directories.