set

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 0 Imported by: 2

Documentation

Overview

Package set

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{}

Set string set

func New added in v1.1.0

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

func (Set[T]) Add

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

func (Set[T]) Clear added in v1.1.0

func (s Set[T]) Clear()

func (Set[T]) Copy added in v1.1.0

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

func (Set[T]) Del

func (s Set[T]) Del(keyList ...T) Set[T]

func (Set[T]) Difference

func (s Set[T]) Difference(other Set[T]) Set[T]

Difference 差集

func (Set[T]) Empty

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

func (Set[K]) Has

func (s Set[K]) Has(key K) bool

func (Set[T]) Intersection

func (s Set[T]) Intersection(other Set[T]) Set[T]

Intersection 交集

func (Set[T]) Range added in v1.2.0

func (s Set[T]) Range(f func(item T) bool)

Range 遍历集合,func(item T) bool 函数发生异常或返回false终止遍历

func (Set[T]) Size

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

func (Set[T]) SymmetricDifference added in v1.1.0

func (s Set[T]) SymmetricDifference(other Set[T]) Set[T]

SymmetricDifference 异或集

func (Set[T]) ToList

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

func (Set[T]) Union

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

Union 并集

Jump to

Keyboard shortcuts

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