sets

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseSet

type BaseSet[E comparable] map[E]struct{}

func NewSet

func NewSet[E comparable](s ...E) BaseSet[E]

func (BaseSet[E]) Add

func (s BaseSet[E]) Add(e ...E)

func (BaseSet[E]) Clear

func (s BaseSet[E]) Clear()

func (BaseSet[E]) Contains

func (s BaseSet[E]) Contains(e E) bool

func (BaseSet[E]) Len

func (s BaseSet[E]) Len() int

func (BaseSet[E]) Remove

func (s BaseSet[E]) Remove(e E)

func (BaseSet[E]) Values

func (s BaseSet[E]) Values() []E

type OrderedSet

type OrderedSet[E comparable] struct {
	// contains filtered or unexported fields
}

func NewOrderedSet

func NewOrderedSet[E comparable](elements ...E) *OrderedSet[E]

func (*OrderedSet[E]) Add

func (s *OrderedSet[E]) Add(e ...E)

func (*OrderedSet[E]) Clear

func (s *OrderedSet[E]) Clear()

func (*OrderedSet[E]) Contains

func (s *OrderedSet[E]) Contains(e E) bool

func (*OrderedSet[E]) Len

func (s *OrderedSet[E]) Len() int

func (*OrderedSet[E]) Remove

func (s *OrderedSet[E]) Remove(e E)

func (*OrderedSet[E]) Values

func (s *OrderedSet[E]) Values() []E

type Set

type Set[E comparable] interface {
	Contains(e E) bool
	Add(e ...E)
	Remove(e E)
	Clear()
	Values() []E
	Len() int
}

Jump to

Keyboard shortcuts

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