immutable_set

package
v0.0.0-...-b6e66c0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 3 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[Value any] immutable_rb_tree.RBTree[Value]

The zero value of `Set` makes nonsense.

func FromValues

func FromValues[Value any](cmp comparator.Comparator[Value], values ...Value) *Set[Value]

func New

func New[Value any](cmp comparator.Comparator[Value]) *Set[Value]

func (*Set[Value]) All

func (s *Set[Value]) All() iter.Seq[Value]

func (*Set[Value]) Count

func (s *Set[Value]) Count() int

func (*Set[Value]) Delete

func (s *Set[Value]) Delete(value Value) (newSet *Set[Value], affected bool)

`affected` is true, meaning that a real deletion occurred, `newSet` will be different from the original; otherwise nothing happens, `newSet` is the original one.

func (*Set[Value]) Empty

func (s *Set[Value]) Empty() bool

func (*Set[Value]) Has

func (s *Set[Value]) Has(value Value) bool

func (*Set[Value]) Insert

func (s *Set[Value]) Insert(value Value) (newSet *Set[Value], affected bool)

`newSet` returned by `Insert()` is always different from the original one. `affected` is true, meaning an actual insertion occurred; otherwise, a replacement occurred.

func (*Set[Value]) Values

func (s *Set[Value]) Values() []Value

Jump to

Keyboard shortcuts

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