dic

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 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 ConcurrentDictionary

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

ConcurrentDictionary is a thread-safe dictionary.

func NewConcurrentDictionary

func NewConcurrentDictionary[K comparable, V any]() *ConcurrentDictionary[K, V]

NewConcurrentDictionary creates a new ConcurrentDictionary.

func (*ConcurrentDictionary[K, V]) Add

func (d *ConcurrentDictionary[K, V]) Add(key K, value V) bool

Add adds a new item to the dictionary.

func (*ConcurrentDictionary[K, V]) Contains

func (d *ConcurrentDictionary[K, V]) Contains(key K) bool

func (*ConcurrentDictionary[K, V]) Count

func (d *ConcurrentDictionary[K, V]) Count() int

func (*ConcurrentDictionary[K, V]) Get

func (d *ConcurrentDictionary[K, V]) Get(key K) (V, bool)

func (*ConcurrentDictionary[K, V]) Iterator

func (d *ConcurrentDictionary[K, V]) Iterator() map[K]V

func (*ConcurrentDictionary[K, V]) Keys

func (d *ConcurrentDictionary[K, V]) Keys() []K

func (*ConcurrentDictionary[K, V]) MarshalJSON

func (d *ConcurrentDictionary[K, V]) MarshalJSON() ([]byte, error)

func (*ConcurrentDictionary[K, V]) ROper added in v0.0.16

func (d *ConcurrentDictionary[K, V]) ROper(f func(m map[K]V))

func (*ConcurrentDictionary[K, V]) Remove

func (d *ConcurrentDictionary[K, V]) Remove(key K) bool

func (*ConcurrentDictionary[K, V]) Set

func (d *ConcurrentDictionary[K, V]) Set(key K, value V)

func (*ConcurrentDictionary[K, V]) String added in v0.0.16

func (d *ConcurrentDictionary[K, V]) String() string

func (*ConcurrentDictionary[K, V]) UnmarshalJSON

func (d *ConcurrentDictionary[K, V]) UnmarshalJSON(b []byte) error

func (*ConcurrentDictionary[K, V]) Values

func (d *ConcurrentDictionary[K, V]) Values() []V

func (*ConcurrentDictionary[K, V]) WOper added in v0.0.16

func (d *ConcurrentDictionary[K, V]) WOper(f func(m map[K]V))

type Dictionary

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

func NewDictionary

func NewDictionary[K comparable, V any]() *Dictionary[K, V]

func (*Dictionary[K, V]) Add

func (d *Dictionary[K, V]) Add(key K, value V) bool

func (*Dictionary[K, V]) Clone

func (d *Dictionary[K, V]) Clone() *Dictionary[K, V]

func (*Dictionary[K, V]) CloneToMap

func (d *Dictionary[K, V]) CloneToMap() map[K]V

func (*Dictionary[K, V]) Contains

func (d *Dictionary[K, V]) Contains(key K) bool

func (*Dictionary[K, V]) Count

func (d *Dictionary[K, V]) Count() int

func (*Dictionary[K, V]) Get

func (d *Dictionary[K, V]) Get(key K) (value V, ok bool)

func (*Dictionary[K, V]) Iterator

func (d *Dictionary[K, V]) Iterator() map[K]V

func (*Dictionary[K, V]) Keys

func (d *Dictionary[K, V]) Keys() []K

func (*Dictionary[K, V]) MarshalJSON

func (d *Dictionary[K, V]) MarshalJSON() ([]byte, error)

func (*Dictionary[K, V]) Remove

func (d *Dictionary[K, V]) Remove(key K) bool

func (*Dictionary[K, V]) Set

func (d *Dictionary[K, V]) Set(key K, value V)

func (*Dictionary[K, V]) String

func (d *Dictionary[K, V]) String() string

func (*Dictionary[K, V]) UnmarshalJSON

func (d *Dictionary[K, V]) UnmarshalJSON(b []byte) error

func (*Dictionary[K, V]) Values

func (d *Dictionary[K, V]) Values() []V

type IDictionary

type IDictionary[K comparable, V any] interface {
	Add(key K, value V) bool
	Set(key K, value V)
	Get(key K) (value V, ok bool)
	Remove(key K) (ok bool)
	Contains(key K) bool
	Keys() []K
	Values() []V
	Count() int
	Iterator() map[K]V
}

Jump to

Keyboard shortcuts

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