Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hashmap ¶
type Hashmap[K, V any] interface { Put(key K, val V) Get(key K) (val V, exists bool) Delete(key K) (deleted bool) 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 ¶
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[K, V any] interface { Hashmap[K, V] Oldest() (key K, val V, exists bool) Newest() (key K, val V, exists bool) NewIterator() Iter[K, V] }
LinkedHashmap is a hashmap that keeps track of the oldest pairing an the newest pairing.
func New ¶
func New[K comparable, V any]() LinkedHashmap[K, V]
Click to show internal directories.
Click to hide internal directories.