sets

package
v0.0.0-...-016edcc Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 2 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[K comparable, T any] struct {
	// contains filtered or unexported fields
}

func NewIdentitySet

func NewIdentitySet[T comparable](cap int) *Set[T, T]

func NewIdentitySetFrom

func NewIdentitySetFrom[T comparable](vs []T) *Set[T, T]

func NewSet

func NewSet[K comparable, T any](f func(T) K, cap int) *Set[K, T]

func NewSetFrom

func NewSetFrom[K comparable, T any](f func(T) K, vs []T) *Set[K, T]

func (*Set[K, T]) Add

func (ts *Set[K, T]) Add(t T) bool

func (*Set[K, T]) AddAll

func (ts *Set[K, T]) AddAll(ats []T)

func (*Set[K, T]) Copy

func (ts *Set[K, T]) Copy() *Set[K, T]

func (*Set[K, T]) GetKey

func (ts *Set[K, T]) GetKey(k K) T

func (*Set[K, T]) Has

func (ts *Set[K, T]) Has(t T) bool

func (*Set[K, T]) Len

func (ts *Set[K, T]) Len() int

func (*Set[K, T]) Pop

func (ts *Set[K, T]) Pop(i int) T

func (*Set[K, T]) Remove

func (ts *Set[K, T]) Remove(v T)

func (*Set[K, T]) Slice

func (ts *Set[K, T]) Slice() []T

type StringSet

type StringSet = Set[string, string]

func NewStringSet

func NewStringSet(cap int) *StringSet

Jump to

Keyboard shortcuts

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