setx

package
v0.0.0-...-1c9d968 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 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 ISet

type ISet interface {
	Add(item any)

	AddAll(set Set[any])

	Contains(item any) bool

	ContainsAll(set Set[any]) bool

	ToSlice() []any

	Remove(item any) bool

	RemoveAll(set Set[any]) bool

	Clear() bool

	Len() int

	IsEmpty() bool

	Clone()
}

type Set

type Set[T comparable] struct {
	// contains filtered or unexported fields
}

func DiffSet

func DiffSet[T comparable](s1, s2 Set[T]) Set[T]

DiffSet return s1 - s2

func IntersectionSet

func IntersectionSet[T comparable](s1, s2 Set[T]) Set[T]

IntersectionSet return s1 & s2

func NewSet

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

func NewSetFromSlice

func NewSetFromSlice[T comparable](slices ...[]T) Set[T]

func UnionSet

func UnionSet[T comparable](sets ...Set[T]) Set[T]

UnionSet return union of all sets

func (Set[T]) Add

func (s Set[T]) Add(items ...T)

func (Set[T]) AddAll

func (s Set[T]) AddAll(set Set[T])

func (Set[T]) Clear

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

func (Set[T]) Clone

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

func (Set[T]) Contains

func (s Set[T]) Contains(items ...T) bool

func (Set[T]) ContainsAll

func (s Set[T]) ContainsAll(set Set[T]) bool

func (Set[T]) IsEmpty

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

func (Set[T]) Len

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

func (Set[T]) Remove

func (s Set[T]) Remove(items ...T) bool

func (Set[T]) RemoveAll

func (s Set[T]) RemoveAll(set Set[T]) bool

func (Set[T]) ToSlice

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

Jump to

Keyboard shortcuts

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