linkedhashmap

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hashmap

type Hashmap interface {
	Put(key, val interface{})
	Get(key interface{}) (val interface{}, exists bool)
	Delete(key interface{})
	Len() int
}

Hashmap provides an O(1) mapping from a comparable key to any value. Comparable is defined by https://golang.org/ref/spec#Comparison_operators.

type Iter

type Iter interface {
	Next() bool
	Key() interface{}
	Value() interface{}
}

Iterates over the keys and values in a LinkedHashmap from oldest to newest elements. Assumes the underlying LinkedHashmap is not modified while the iterator is in use, except to delete elements that have already been iterated over.

type LinkedHashmap

type LinkedHashmap interface {
	Hashmap

	Oldest() (key interface{}, val interface{}, exists bool)
	Newest() (key interface{}, val interface{}, exists bool)
	NewIterator() Iter
}

LinkedHashmap is a hashmap that keeps track of the oldest pairing an the newest pairing.

func New

func New() LinkedHashmap

Jump to

Keyboard shortcuts

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