orderedmap

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: GPL-3.0 Imports: 0 Imported by: 1

README

Ordered Map

Ordered Map

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterator

type Iterator[T any] interface {
	HasNext() bool
	Next() bool
	GetNext() (T, bool)
	GetCurrent() (T, bool)
}

Iterator is an iterator over a OrderedMap.

type OrderedMap

type OrderedMap[T any] interface {
	Len() int
	Set(key any, val T)
	Get(key any) (T, bool)
	Delete(key any) (T, bool)
	Index(key any) int
	ReplaceKey(oldKey any, newKey any) bool
	SetBefore(presentKey any, newKey any, val T) (int, bool)
	SetAfter(presentKey any, newKey any, val T) (int, bool)
	GetIterator() Iterator[T]
}

OrderedMap is a map with ordered keys

func New

func New[T any]() OrderedMap[T]

New creates a new OrderedMap.

Jump to

Keyboard shortcuts

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