Documentation ¶
Index ¶
- func Equals[K any, V comparable](l Dict[K, V], r Dict[K, V]) bool
- func HashDictCollector[K comparable, V any]() iter.Collector[*HashDict[K, V], util.Pair[K, V], *HashDict[K, V]]
- type Dict
- type HashDict
- func HashDictFrom[K comparable, V any](collection iter.Collection[util.Pair[K, V]]) *HashDict[K, V]
- func HashDictOf[K comparable, V any](elements ...util.Pair[K, V]) *HashDict[K, V]
- func MakeHashDict[K comparable, V any](capacity int) *HashDict[K, V]
- func MakeHashDictWithHasher[K comparable, V any](hasher func(K) uint64, capacity int) *HashDict[K, V]
- func (a *HashDict[K, V]) At(key K) util.Ref[V]
- func (a *HashDict[K, V]) Clear()
- func (a *HashDict[K, V]) Clone() *HashDict[K, V]
- func (a *HashDict[K, V]) Contains(key K) bool
- func (a *HashDict[K, V]) Count() int
- func (a *HashDict[K, V]) Iterator() iter.Iterator[util.Pair[K, V]]
- func (a *HashDict[K, V]) Put(key K, value V) util.Opt[V]
- func (a *HashDict[K, V]) Remove(key K) util.Opt[V]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashDictCollector ¶
Types ¶
type Dict ¶
type Dict[K any, V any] interface { iter.Collection[util.Pair[K, V]] Contains(key K) bool At(key K) util.Ref[V] Put(key K, value V) util.Opt[V] Remove(key K) util.Opt[V] Clear() }
Collection's extended interfaces, can provide more functional abstraction for maps.
type HashDict ¶
type HashDict[K comparable, V any] struct { // contains filtered or unexported fields }
func HashDictFrom ¶
func HashDictFrom[K comparable, V any](collection iter.Collection[util.Pair[K, V]]) *HashDict[K, V]
func HashDictOf ¶
func HashDictOf[K comparable, V any](elements ...util.Pair[K, V]) *HashDict[K, V]
func MakeHashDict ¶
func MakeHashDict[K comparable, V any](capacity int) *HashDict[K, V]
func MakeHashDictWithHasher ¶
func MakeHashDictWithHasher[K comparable, V any](hasher func(K) uint64, capacity int) *HashDict[K, V]
Click to show internal directories.
Click to hide internal directories.