sets

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterator added in v1.3.0

type Iterator[T any] interface {
	iter.Iterator[T]

	// Remove removes the current element
	Remove()
}

Iterator is an iterator over a set.

type Set

type Set[T any] interface {
	// Size returns the size of the set
	Size() int

	// Add adds the given value to the set
	Add(value T)
	// Remove removes the given value from the set
	Remove(value T)
	// Contains returns true if the set contains the given value
	Contains(value T) bool

	// Clear clears the set
	Clear()
	misc.Cloner[Set[T]]

	iter.Iterable[T]
	// SetIterator returns an iterator over the set
	SetIterator() Iterator[T]
	// Stream streams elements of the set
	Stream(yield func(T) bool)
}

Set is an interface that represents a set of elements

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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