Documentation ¶
Index ¶
- type HashSet
- func (s HashSet[V]) Add(items ...V)
- func (s HashSet[V]) Difference(other Set[V]) Set[V]
- func (s HashSet[V]) Has(n V) bool
- func (s HashSet[V]) Intersection(other Set[V]) Set[V]
- func (s HashSet[V]) Len() int
- func (s HashSet[V]) Remove(items ...V)
- func (s HashSet[V]) Slice() []V
- func (s HashSet[V]) Union(other Set[V]) Set[V]
- type Set
- type SliceSet
- func (s *SliceSet[A]) Add(items ...A)
- func (s *SliceSet[V]) Difference(other Set[V]) Set[V]
- func (s *SliceSet[A]) Has(item A) bool
- func (s *SliceSet[V]) Intersection(other Set[V]) Set[V]
- func (s *SliceSet[A]) Len() int
- func (s *SliceSet[A]) Remove(items ...A)
- func (s *SliceSet[A]) Slice() []A
- func (s SliceSet[V]) Union(other Set[V]) Set[V]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashSet ¶
type HashSet[V constraints.Ordered] struct { // contains filtered or unexported fields }
func (HashSet[V]) Difference ¶ added in v0.0.4
func (HashSet[V]) Intersection ¶ added in v0.0.4
type Set ¶
type Set[A constraints.Ordered] interface { Add(item ...A) Remove(item ...A) Has(item A) bool Intersection(other Set[A]) Set[A] Difference(other Set[A]) Set[A] Union(other Set[A]) Set[A] Slice() []A Len() int }
func NewHashSet ¶
func NewHashSet[V constraints.Ordered](items ...V) Set[V]
func NewSliceSet ¶
func NewSliceSet[A constraints.Ordered](items ...A) Set[A]
type SliceSet ¶
type SliceSet[A constraints.Ordered] struct { // contains filtered or unexported fields }
func (*SliceSet[V]) Difference ¶ added in v0.0.4
func (*SliceSet[V]) Intersection ¶ added in v0.0.4
Click to show internal directories.
Click to hide internal directories.