collection

package
v0.0.0-...-b28e12a Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArraySet

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

ArraySet is a set implementation that uses an array to maintain order.

func NewArraySet

func NewArraySet[T comparable]() *ArraySet[T]

NewArraySet creates a new ArraySet instance.

func (*ArraySet[T]) Add

func (s *ArraySet[T]) Add(data T)

Add adds an element to the set if it doesn't already exist.

func (*ArraySet[T]) List

func (s *ArraySet[T]) List() []T

List returns a slice of the set's elements in the order they were added.

Jump to

Keyboard shortcuts

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