mymap

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapKeys

func MapKeys[K comparable, V any](m map[K]V) []K

func MapKeysVals

func MapKeysVals[K comparable, V any](m map[K]V) ([]K, []V)

func MapVals

func MapVals[K comparable, V any](m map[K]V) []V

Types

type Map

type Map[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewMap

func NewMap[K comparable, V any]() *Map[K, V]

func (*Map[K, V]) Insert

func (l *Map[K, V]) Insert(k K, v V)

func (*Map[K, V]) Keys

func (l *Map[K, V]) Keys() *mylist.List[K]

func (*Map[K, V]) Len

func (l *Map[K, V]) Len() int

func (*Map[K, V]) Range

func (l *Map[K, V]) Range(f func(key K, value V))

func (*Map[K, V]) Remove

func (l *Map[K, V]) Remove(k K)

func (*Map[K, V]) RemoveKeys

func (l *Map[K, V]) RemoveKeys(listK []K)

func (*Map[K, V]) Reset

func (l *Map[K, V]) Reset(len int)

func (*Map[K, V]) ResetByMap

func (l *Map[K, V]) ResetByMap(items map[K]V)

func (*Map[K, V]) Search

func (l *Map[K, V]) Search(f func(key K, value V) bool)

func (*Map[K, V]) TakeAt

func (l *Map[K, V]) TakeAt(k K) (v V, b bool)

func (*Map[K, V]) ToArray

func (l *Map[K, V]) ToArray() (allKeys []K, allValues []V)

func (*Map[K, V]) ToMap

func (l *Map[K, V]) ToMap() map[K]V

func (*Map[K, V]) Value

func (l *Map[K, V]) Value(k K) (v V, b bool)

func (*Map[K, V]) Values

func (l *Map[K, V]) Values() *mylist.List[V]

type MultiMap

type MultiMap[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewMultiMap

func NewMultiMap[K comparable, V any]() *MultiMap[K, V]

func (*MultiMap[K, V]) HasKey

func (l *MultiMap[K, V]) HasKey(k K) bool

func (*MultiMap[K, V]) Insert

func (l *MultiMap[K, V]) Insert(key K, value V)

func (*MultiMap[K, V]) Keys

func (l *MultiMap[K, V]) Keys() *mylist.List[K]

func (*MultiMap[K, V]) Len

func (l *MultiMap[K, V]) Len() int

func (*MultiMap[K, V]) Range

func (l *MultiMap[K, V]) Range(f func(key K, value V))

func (*MultiMap[K, V]) RangeKey

func (l *MultiMap[K, V]) RangeKey(key K, f func(index int, value V))

func (*MultiMap[K, V]) Remove

func (l *MultiMap[K, V]) Remove(key K)

func (*MultiMap[K, V]) RemoveAtIndex

func (l *MultiMap[K, V]) RemoveAtIndex(key K, index int)

func (*MultiMap[K, V]) Removes

func (l *MultiMap[K, V]) Removes(key K)

func (*MultiMap[K, V]) Search

func (l *MultiMap[K, V]) Search(f func(key K, value V) bool)

func (*MultiMap[K, V]) SearchKey

func (l *MultiMap[K, V]) SearchKey(key K, f func(index int, value V) bool)

func (*MultiMap[K, V]) TakeAt

func (l *MultiMap[K, V]) TakeAt(k K) (v V, b bool)

func (*MultiMap[K, V]) Value

func (l *MultiMap[K, V]) Value(k K) (v V, b bool)

func (*MultiMap[K, V]) Values

func (l *MultiMap[K, V]) Values(key K) (values []V, b bool)

Jump to

Keyboard shortcuts

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