Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OrderedSet ¶
type OrderedSet[T comparable] struct { Parent *OrderedSet[T] // contains filtered or unexported fields }
func NewOrderedSet ¶
func NewOrderedSet[T comparable](parent *OrderedSet[T]) *OrderedSet[T]
NewOrderedSet returns a set with the given parent. To create an empty set, pass nil.
func (*OrderedSet[T]) AddIntersection ¶
func (s *OrderedSet[T]) AddIntersection(a, b *OrderedSet[T])
AddIntersection adds the members that exist in both given member sets.
func (*OrderedSet[T]) Clone ¶
func (s *OrderedSet[T]) Clone() *OrderedSet[T]
Clone returns a new child set that contains all items of this parent set. Changes to the returned set will only be applied in the returned set, not the parent.
func (*OrderedSet[T]) Contains ¶
func (s *OrderedSet[T]) Contains(item T) (present bool)
Contains returns true if the given item exists in the set.
func (*OrderedSet[T]) ForEach ¶
func (s *OrderedSet[T]) ForEach(cb func(item T) error) error
ForEach calls the given function for each item. It can be used to iterate over all items of the set.
func (*OrderedSet[T]) IsEmpty ¶
func (s *OrderedSet[T]) IsEmpty() bool
IsEmpty returns true if the set is empty, or false if it contains items.
Click to show internal directories.
Click to hide internal directories.