Documentation
¶
Index ¶
- type HashSet
- func (s *HashSet[T, K]) Add(items ...T) *HashSet[T, K]
- func (s *HashSet[T, K]) Clear() *HashSet[T, K]
- func (s *HashSet[T, K]) Clone() *HashSet[T, K]
- func (s *HashSet[T, K]) Complement(others ...HashSet[T, K]) *HashSet[T, K]
- func (s HashSet[T, K]) Contains(item T) bool
- func (s HashSet[T, K]) ContainsAll(items ...T) bool
- func (s HashSet[T, K]) ContainsAny(items ...T) bool
- func (s *HashSet[T, K]) Delete(items ...T)
- func (s *HashSet[T, K]) Equal(other HashSet[T, K]) bool
- func (s *HashSet[T, K]) Intersection(others ...HashSet[T, K]) *HashSet[T, K]
- func (s *HashSet[T, K]) Items() (res []T)
- func (s *HashSet[T, K]) Size() int
- func (s *HashSet[T, K]) Union(others ...HashSet[T, K]) *HashSet[T, K]
- type Hasher
- type Set
- func (s *Set[T]) Add(items ...T) *Set[T]
- func (s *Set[T]) Clear() *Set[T]
- func (s *Set[T]) Clone() *Set[T]
- func (s *Set[T]) Complement(others ...Set[T]) *Set[T]
- func (s Set[T]) Contains(item T) bool
- func (s Set[T]) ContainsAll(items ...T) bool
- func (s Set[T]) ContainsAny(items ...T) bool
- func (s *Set[T]) Delete(items ...T) *Set[T]
- func (s *Set[T]) Equal(other Set[T]) bool
- func (s *Set[T]) Intersection(others ...Set[T]) *Set[T]
- func (s *Set[T]) Items() (res []T)
- func (s *Set[T]) Size() int
- func (s *Set[T]) Union(others ...Set[T]) *Set[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashSet ¶
type HashSet[T any, K comparable] struct { // contains filtered or unexported fields }
func NewHashSet ¶
func NewHashSet[T any, K comparable](hash Hasher[T, K], vals ...T) *HashSet[T, K]
func NewHashSetUnion ¶ added in v0.11.4
func NewHashSetUnion[T any, K comparable](sets ...HashSet[T, K]) (s *HashSet[T, K])
Create a new set that is the union of all provided sets
func (*HashSet[T, K]) Complement ¶
func (HashSet[T, K]) ContainsAll ¶
func (HashSet[T, K]) ContainsAny ¶
func (*HashSet[T, K]) Equal ¶ added in v0.11.4
Two sets are considered equal if they contain exactly the same elements.
func (*HashSet[T, K]) Intersection ¶
Intersection will reduce this set to the items that are present in this set and the other sets
type Hasher ¶
type Hasher[T any, K comparable] func(T) K
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
func New ¶
func New[T comparable](vals ...T) *Set[T]
func NewUnion ¶ added in v0.11.4
func NewUnion[T comparable](sets ...Set[T]) (s *Set[T])
Create a new set that is the union of all provided sets
func (*Set[T]) Complement ¶
Complement will remove all items from this set that are present in the other sets. This mutates the set.
func (Set[T]) ContainsAll ¶
func (Set[T]) ContainsAny ¶
func (*Set[T]) Equal ¶ added in v0.11.4
Two sets are considered equal if they contain exactly the same elements.
func (*Set[T]) Intersection ¶
Intersection will reduce this set to the items that are present in this set and the other sets. This mutates the set.
Click to show internal directories.
Click to hide internal directories.