immutable

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayIntToInt64

func ArrayIntToInt64(v []int) []int64

func HashInt

func HashInt(v any) uint64

func HashIntArray

func HashIntArray(v []int) uint64

func HashString

func HashString(v string) uint64

func Rehash

func Rehash(v uint64) uint64

Types

type Set

type Set[K SetElement] struct {
	// contains filtered or unexported fields
}

func FromHashSet

func FromHashSet[K SetElement](set *hashset.Set[K]) *Set[K]

func Of

func Of[K SetElement](vals ...K) *Set[K]

Of returns a new hashset initialized with the given 'vals'

func (Set[K]) Difference

func (s Set[K]) Difference(a Set[K]) Set[K]

func (Set[K]) Each

func (s Set[K]) Each(fn func(key K))

func (Set[K]) Equals

func (s Set[K]) Equals(element SetElement) bool

func (Set[K]) GetHash

func (s Set[K]) GetHash() uint64

func (Set[K]) Has

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

func (Set[K]) IsSuperset

func (s Set[K]) IsSuperset(a Set[K]) bool

func (Set[K]) Size

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

func (Set[K]) ToHashSet

func (s Set[K]) ToHashSet() hashset.Set[K]

func (Set[K]) ToSlice

func (s Set[K]) ToSlice() []K

func (Set[K]) Union

func (s Set[K]) Union(a Set[K]) Set[K]

type SetElement

type SetElement interface {
	GetHash() uint64
	Equals(element SetElement) bool
}

Jump to

Keyboard shortcuts

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