hashset

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set[T comparable] map[T]struct{}

func New

func New[T comparable](vals ...T) *Set[T]

func NewWith added in v0.2.2

func NewWith[T comparable](cardinality int, vals ...T) *Set[T]

func (*Set[T]) Add

func (s *Set[T]) Add(v T) bool

func (*Set[T]) Append added in v0.2.2

func (s *Set[T]) Append(v ...T) int

func (*Set[T]) Clear

func (s *Set[T]) Clear()

func (*Set[T]) Clone added in v0.2.2

func (s *Set[T]) Clone() container.Set[T]

func (*Set[T]) Contains

func (s *Set[T]) Contains(v ...T) bool

func (*Set[T]) ContainsAny added in v0.2.2

func (s *Set[T]) ContainsAny(v ...T) bool

func (*Set[T]) ContainsAnyElement added in v0.2.2

func (s *Set[T]) ContainsAnyElement(other container.Set[T]) bool

func (*Set[T]) ContainsOne added in v0.2.2

func (s *Set[T]) ContainsOne(v T) bool

func (*Set[T]) Difference

func (s *Set[T]) Difference(other container.Set[T]) container.Set[T]

func (*Set[T]) Each added in v0.2.2

func (s *Set[T]) Each(cb func(T) bool)

func (*Set[T]) Equal added in v0.2.2

func (s *Set[T]) Equal(other container.Set[T]) bool

func (*Set[T]) Intersect added in v0.2.2

func (s *Set[T]) Intersect(other container.Set[T]) container.Set[T]

func (*Set[T]) IsEmpty added in v0.2.2

func (s *Set[T]) IsEmpty() bool

func (*Set[T]) IsProperSubset added in v0.2.2

func (s *Set[T]) IsProperSubset(other container.Set[T]) bool

func (*Set[T]) IsProperSuperset added in v0.2.2

func (s *Set[T]) IsProperSuperset(other container.Set[T]) bool

func (*Set[T]) IsSubset added in v0.2.2

func (s *Set[T]) IsSubset(other container.Set[T]) bool

func (*Set[T]) IsSuperset added in v0.2.2

func (s *Set[T]) IsSuperset(other container.Set[T]) bool

func (*Set[T]) Iter added in v0.2.2

func (s *Set[T]) Iter() iter.Seq[T]

Iter returns an iterator over all elements in the set in sorted order.

func (*Set[T]) Len added in v0.2.2

func (s *Set[T]) Len() int

func (Set[T]) MarshalJSON

func (s Set[T]) MarshalJSON() ([]byte, error)

func (*Set[T]) Pop added in v0.2.2

func (s *Set[T]) Pop() (v T, ok bool)

if set is already empty.

func (Set[T]) Remove

func (s Set[T]) Remove(v T)

func (Set[T]) RemoveAll added in v0.2.2

func (s Set[T]) RemoveAll(i ...T)

func (Set[T]) String

func (s Set[T]) String() string

func (*Set[T]) SymmetricDifference added in v0.2.2

func (s *Set[T]) SymmetricDifference(other container.Set[T]) container.Set[T]

func (Set[T]) ToSlice added in v0.2.2

func (s Set[T]) ToSlice() []T

func (Set[T]) Union

func (s Set[T]) Union(other container.Set[T]) container.Set[T]

func (*Set[T]) UnmarshalJSON

func (s *Set[T]) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL