hashmap

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package hashmap provides a built-in implementation of a generic map

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T0

type T0 string

T0 is a generic type variable placeholder of a key type. It will not appear in the generated code

type T0T1Map

type T0T1Map interface {
	// Each visits each element in the map. It stops iterations if visitor func returns false
	Each(visitor T0T1MapVisitor)

	// Get returns the value of a given key. If the key was not found the second return value will be false
	Get(key T0) (v T1, found bool)

	// Set sets the value of a given key
	Set(key T0, val T1)

	// Update updates the current map from a given map
	Update(src map[T0]T1) T0T1Map

	// Remove removes a given key from this map
	Remove(key T0) bool

	// Clone creates a copy of this map
	Clone() T0T1Map
}

T0T1Map exposes the contract of T0 to T1 map

func NewT0T1Map

func NewT0T1Map() T0T1Map

NewT0T1Map creates a basic instance of the T0T1Map. It is _unsafe_ for concurrent access.

func NewT0T1MapSyncronized

func NewT0T1MapSyncronized() T0T1Map

NewT0T1MapSyncronized creates a concurrent safe instance of the T0T1Map

type T0T1MapVisitor

type T0T1MapVisitor func(T0, T1) bool

T0T1MapVisitor is a visitor function to visit map pairs

type T1

type T1 int

T1 is a generic type variable placeholder of a value type. It will not appear in the generated code

Jump to

Keyboard shortcuts

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