set

package
v6.0.0-...-4ba06ae Latest Latest
Warning

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

Go to latest
Published: May 9, 2025 License: Apache-2.0 Imports: 0 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] struct {
	// contains filtered or unexported fields
}

func Define

func Define[T comparable](items ...T) Set[T]

func New

func New[T comparable](capacity int) Set[T]

func (*Set[T]) Add

func (s *Set[T]) Add(item ...T)

func (*Set[T]) AddFromAnother

func (s *Set[T]) AddFromAnother(another Set[T])

func (*Set[T]) AddFromSlice

func (s *Set[T]) AddFromSlice(items []T)

func (*Set[T]) Clone

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

func (*Set[T]) Contains

func (s *Set[T]) Contains(item T) bool

func (*Set[T]) Intersect

func (s *Set[T]) Intersect(another Set[T])

func (*Set[T]) IsEqual

func (s *Set[T]) IsEqual(other Set[T]) bool

IsEqual returns true if the passed set is equal to this one

func (*Set[T]) IsSubSet

func (s *Set[T]) IsSubSet(other Set[T]) bool

IsSubset returns true if the passed set is a subset of this one

func (*Set[T]) Len

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

func (*Set[T]) Range

func (s *Set[T]) Range(callback func(item T) bool)

func (*Set[T]) Remove

func (s *Set[T]) Remove(item T)

func (*Set[T]) ToSlice

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

func (*Set[T]) Union

func (s *Set[T]) Union(another Set[T])

Jump to

Keyboard shortcuts

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