containers

package
v0.0.0-...-7c04f0e Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 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 HashSet

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

func NewHashSet

func NewHashSet[T comparable](estimatedCard int) *HashSet[T]

func (*HashSet[T]) Add

func (inst *HashSet[T]) Add(val T)

func (*HashSet[T]) All

func (inst *HashSet[T]) All() iter.Seq[T]

func (*HashSet[T]) Clear

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

func (*HashSet[T]) DifferenceMod

func (inst *HashSet[T]) DifferenceMod(other *HashSet[T])

func (*HashSet[T]) Equal

func (inst *HashSet[T]) Equal(other HashSet[T]) bool

func (*HashSet[T]) ForEach

func (inst *HashSet[T]) ForEach(handler func(v T))

func (*HashSet[T]) Has

func (inst *HashSet[T]) Has(val T) bool

func (*HashSet[T]) IntersectMod

func (inst *HashSet[T]) IntersectMod(other *HashSet[T])

func (*HashSet[T]) Remove

func (inst *HashSet[T]) Remove(val T)

func (*HashSet[T]) Size

func (inst *HashSet[T]) Size() int

func (*HashSet[T]) Slice

func (inst *HashSet[T]) Slice() []T

func (*HashSet[T]) SliceEx

func (inst *HashSet[T]) SliceEx(in []T) (out []T)

func (*HashSet[T]) UnionMod

func (inst *HashSet[T]) UnionMod(other *HashSet[T])

func (*HashSet[T]) Until

func (inst *HashSet[T]) Until(handler func(v T) bool)

type Stack

type Stack[T any] struct {
	Items []T
}

func NewStack

func NewStack[T any]() *Stack[T]

func NewStackSize

func NewStackSize[T any](n int) *Stack[T]

func (*Stack[T]) Depth

func (stack *Stack[T]) Depth() int

func (*Stack[T]) Peek

func (stack *Stack[T]) Peek() (retr T, err error)

func (*Stack[T]) PeekDefault

func (stack *Stack[T]) PeekDefault(emptyValue T) (retr T)

func (*Stack[T]) Pop

func (stack *Stack[T]) Pop() (retr T, err error)

func (*Stack[T]) PopDefault

func (stack *Stack[T]) PopDefault(emptyValue T) (retr T)

func (*Stack[T]) Push

func (stack *Stack[T]) Push(value T)

func (*Stack[T]) Reset

func (stack *Stack[T]) Reset()

func (*Stack[T]) Swap

func (stack *Stack[T]) Swap(newValue T) (oldValue T, err error)

Jump to

Keyboard shortcuts

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