hashmapset

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT-0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder[Obj any, Key comparable] struct {
	// contains filtered or unexported fields
}

func WithGetKey

func WithGetKey[Obj any, Key comparable](getKey func(Obj) Key) Builder[Obj, Key]

func (Builder[Obj, Key]) FromIter

func (b Builder[Obj, Key]) FromIter(seq iter.Seq[Obj]) HashMapSet[Obj, Key]

func (Builder[Obj, Key]) FromSeq

func (b Builder[Obj, Key]) FromSeq(seq seqs.Seq[Obj]) HashMapSet[Obj, Key]

func (Builder[Obj, Key]) FromSlice

func (b Builder[Obj, Key]) FromSlice(objs []Obj) HashMapSet[Obj, Key]

func (Builder[Obj, Key]) FromValues

func (b Builder[Obj, Key]) FromValues(objs ...Obj) HashMapSet[Obj, Key]

type HashMapSet

type HashMapSet[Obj any, Key comparable] struct {
	// contains filtered or unexported fields
}

HashMapSet is a set of objects which are compared using a key derived from them.

func New

func New[Obj any, Key comparable](getKey func(Obj) Key) HashMapSet[Obj, Key]

New returns an empty HashMapSet with the specified key extraction function.

func (HashMapSet[_, _]) Cardinality

func (s HashMapSet[_, _]) Cardinality() (core.Cardinal, bool)

func (HashMapSet[Obj, Key]) Clone

func (s HashMapSet[Obj, Key]) Clone() HashMapSet[Obj, Key]

func (HashMapSet[Obj, _]) Contains

func (s HashMapSet[Obj, _]) Contains(obj Obj) bool

func (*HashMapSet[Obj, _]) Exclude

func (s *HashMapSet[Obj, _]) Exclude(objs ...Obj)

func (*HashMapSet[Obj, _]) ExcludeAll

func (s *HashMapSet[Obj, _]) ExcludeAll(seq iter.Seq[Obj])

func (*HashMapSet[Obj, _]) ExcludeSeq

func (s *HashMapSet[Obj, _]) ExcludeSeq(seq seqs.Seq[Obj])

func (HashMapSet[Obj, _]) ForEachWhile added in v0.8.0

func (s HashMapSet[Obj, _]) ForEachWhile(yield func(Obj) bool)

func (HashMapSet[Obj, Key]) GetByKey

func (s HashMapSet[Obj, Key]) GetByKey(key Key) (Obj, bool)

func (*HashMapSet[Obj, _]) Include

func (s *HashMapSet[Obj, _]) Include(objs ...Obj)

func (*HashMapSet[Obj, _]) IncludeAll

func (s *HashMapSet[Obj, _]) IncludeAll(seq iter.Seq[Obj])

func (*HashMapSet[Obj, _]) IncludeSeq

func (s *HashMapSet[Obj, _]) IncludeSeq(seq seqs.Seq[Obj])

func (HashMapSet[Obj, Key]) Len

func (s HashMapSet[Obj, Key]) Len() int

func (HashMapSet[Obj, _]) Values

func (s HashMapSet[Obj, _]) Values(yield func(Obj) bool)

Jump to

Keyboard shortcuts

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