set

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashSet

type HashSet[T comparable] struct {
	// contains filtered or unexported fields
}

func NewHashSet

func NewHashSet[T comparable](e ...T) *HashSet[T]

func (*HashSet[T]) Add

func (hs *HashSet[T]) Add(e T)

func (*HashSet[T]) AddAll

func (hs *HashSet[T]) AddAll(e ...T)

TODO: SHOULD IT THROW ERRO IF ARGS ARE EMPTY?

func (*HashSet[T]) Clear

func (hs *HashSet[T]) Clear()

func (*HashSet[T]) Contains

func (hs *HashSet[T]) Contains(e T) bool

func (*HashSet[T]) ContainsAll

func (hs *HashSet[T]) ContainsAll(e ...T) bool

func (*HashSet[T]) Copy

func (hs *HashSet[T]) Copy() Set[T]

func (*HashSet[T]) Intersection

func (hs *HashSet[T]) Intersection(s Set[T]) (Set[T], error)

func (*HashSet[T]) IsEmpty

func (hs *HashSet[T]) IsEmpty() bool

func (*HashSet[T]) Iterator

func (hs *HashSet[T]) Iterator() iterator.Iterator[T]

func (*HashSet[T]) Remove

func (hs *HashSet[T]) Remove(e T) error

func (*HashSet[T]) RemoveAll

func (hs *HashSet[T]) RemoveAll(e ...T) error

func (*HashSet[T]) RetainAll

func (hs *HashSet[T]) RetainAll(e ...T) error

func (*HashSet[T]) Size

func (hs *HashSet[T]) Size() int64

func (*HashSet[T]) Union

func (hs *HashSet[T]) Union(s Set[T]) (Set[T], error)

type Set

type Set[T comparable] interface {
	Add(e T)

	AddAll(e ...T)

	Clear()

	Contains(e T) bool

	ContainsAll(e ...T) bool

	Copy() Set[T]

	IsEmpty() bool

	Size() int64

	Remove(e T) error

	RemoveAll(e ...T) error

	RetainAll(e ...T) error

	Iterator() iterator.Iterator[T]

	Union(s Set[T]) (Set[T], error)

	Intersection(s Set[T]) (Set[T], error)
}

Jump to

Keyboard shortcuts

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