Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
Map is a map datastructure that allows accessing it's element in a fixed order.
func New ¶
func New[K comparable, V any]() *Map[K, V]
func (*Map[K, V]) AsSlice ¶
func (m *Map[K, V]) AsSlice() []V
AsSlice returns a new slice containing the elements of the orderedMap in order.
func (*Map[K, V]) Dequeue ¶
func (m *Map[K, V]) Dequeue(key K) (removedElem V)
Dequeue removes the value with the key from the map and returns it. If thekey does not exist in the map, the zero value is returned.
func (*Map[K, V]) EnqueueIfNotExist ¶
EnqueueIfNotExist adds val to the map if K does not exist.
func (*Map[K, V]) First ¶
func (m *Map[K, V]) First() V
First returns the first element in the map. If the map is empty, the zero value is returned.
func (*Map[K, V]) Foreach ¶
Foreach itereates through the map in order. When fn returns false the iteration is aborted.
Click to show internal directories.
Click to hide internal directories.