sortedDictionary

package
v0.0.0-...-41ddf2c Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CapFrom

func CapFrom[TKey comparable, TValue any](e collections.Enumerator[collections.Tuple2[TKey, TValue]], capacity int, comparer ...utils.Comparer[TKey]) collections.Dictionary[TKey, TValue]

CapFrom creates a new dictionary with sorted keys and an initial capacity populated with key/value pairs from the given tuple enumerator.

The keys are sorted with the optional given comparer function or the default comparer if no comparer was given.

func CapNew

func CapNew[TKey comparable, TValue any](capacity int, comparer ...utils.Comparer[TKey]) collections.Dictionary[TKey, TValue]

CapNew creates a new dictionary with sorted keys and initial capacity by the optional given comparer function or the default comparer.

func From

func From[TKey comparable, TValue any](e collections.Enumerator[collections.Tuple2[TKey, TValue]], comparer ...utils.Comparer[TKey]) collections.Dictionary[TKey, TValue]

From creates a new dictionary with sorted keys populated with key/value pairs from the given tuple enumerator.

The keys are sorted with the optional given comparer function or the default comparer if no comparer was given.

func New

func New[TKey comparable, TValue any](comparer ...utils.Comparer[TKey]) collections.Dictionary[TKey, TValue]

New creates a new dictionary with sorted keys by the optional given comparer function or the default comparer.

func With

func With[TKey comparable, TValue any, M ~map[TKey]TValue](m M, comparer ...utils.Comparer[TKey]) collections.Dictionary[TKey, TValue]

With creates a new dictionary with sorted keys populated with key/value pairs from the given map.

The keys are sorted with the optional given comparer function or the default comparer if no comparer was given.

Types

This section is empty.

Jump to

Keyboard shortcuts

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