orderedmap

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map[K any, V any] interface {
	Get(K) V
	GetOk(key K) (V, bool)
	Set(K, V)
	Size() int
	ContainsKey(key K) bool
	Keys() []K
	Merge(...Map[K, V]) Map[K, V]
	SortKeys(f func(x, y K) int)
	SortStableKeys(f func(x, y K) int)
	Values() []V
	Clone() Map[K, V]
	Remove(key K)
	MarshalJSON() ([]byte, error)
}

Map is a map that keeps ordering insertion.

func New

func New[K scalars, V any]() Map[K, V]

New creates a map

func NewWithConversionFunc

func NewWithConversionFunc[K any, V any, C scalars](conv func(K) C) Map[K, V]

NewWithConversionFunc creates a map using the given conversion function to convert non-comparable key type to comparable items. The conversion function must be bijective.

Jump to

Keyboard shortcuts

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

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy