collections

package module
v0.0.0-...-9899634 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection[T any] interface {
	Iterable[T]
	Size() int
	Empty() bool
}

type Deque

type Deque[T any] interface {
	Stack[T]
	Queue[T]
	PeekFront() T
	PeekBack() T
}

type Iterable

type Iterable[T any] interface {
	// All returns an Iterator over all the elements of this Iterable.
	All() iter.Seq[T]
}

Iterable denotes a type that can be iterated over by using the Iterator supplied using the Iterator method.

type List

type List[T any] interface {
	Collection[T]
	Get(idx int) T
}

type Map

type Map[K any, V any] interface {
	Get(K) (V, bool)
	Size() int
	Empty() bool
	ContainsKey(K) bool
	All() iter.Seq2[K, V]
	Keys() iter.Seq[K]
	Values() iter.Seq[V]
}

type MutableCollection

type MutableCollection[T any] interface {
	Collection[T]
	Add(t T)
	Remove() T
	AddAll(iter.Seq[T])
}

type MutableDeque

type MutableDeque[T any] interface {
	Deque[T]
	MutableCollection[T]
	MutableStack[T]
	MutableQueue[T]
	AddFront(t T)
	RemoveFront() T
	AddBack(t T)
	RemoveBack() T
}

type MutableList

type MutableList[T any] interface {
	List[T]
	MutableCollection[T]
	Set(idx int, t T)
}

type MutableMap

type MutableMap[K any, V any] interface {
	Map[K, V]
	Put(K, V)
	Remove(K)
}

type MutableQueue

type MutableQueue[T any] interface {
	Queue[T]
	MutableCollection[T]
}

type MutableSet

type MutableSet[T any] interface {
	MutableCollection[T]
	Set[T]
	RemoveElement(T)
	RemoveAll(Collection[T])
	RetainAll(Collection[T])
}

type MutableStack

type MutableStack[T any] interface {
	Stack[T]
	MutableCollection[T]
	Push(t T)
	Pop() T
}

type Queue

type Queue[T any] interface {
	Collection[T]
	Peek() T
}

type Set

type Set[T any] interface {
	Collection[T]
	Contains(T) bool
	ContainsAll(Collection[T]) bool
}

type Stack

type Stack[T any] interface {
	Collection[T]
	Peek() T
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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