ordered_map

package
v0.0.0-...-d2f97bb Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparable

type Comparable[T any] interface {
	Cmp(T) int
}

type Entry

type Entry[K cmp.Ordered, V any] struct {
	Key K
	Val V
}

func (Entry[K, V]) Cmp

func (e Entry[K, V]) Cmp(o Entry[K, V]) int

type Map

type Map[T Comparable[T]] struct {
	// contains filtered or unexported fields
}

func EmptyComparableMap

func EmptyComparableMap[T Comparable[T]]() Map[T]

func (Map[T]) Del

func (m Map[T]) Del(entryIn T) Map[T]

func (Map[T]) Get

func (m Map[T]) Get(entryIn T) (Comparable[T], bool)

func (Map[T]) Iter

func (m Map[T]) Iter(f func(entryOut T) bool)

func (Map[T]) Len

func (m Map[T]) Len() uint64

func (Map[T]) Max

func (m Map[T]) Max() Comparable[T]

func (Map[T]) Min

func (m Map[T]) Min() Comparable[T]

func (Map[T]) Repr

func (m Map[T]) Repr() []Comparable[T]

func (Map[T]) Set

func (m Map[T]) Set(entryIn T) Map[T]

func (Map[T]) Split

func (m Map[T]) Split(entryIn T) (Map[T], Map[T])

type OrderedMap

type OrderedMap[K cmp.Ordered, V any] struct {
	// contains filtered or unexported fields
}

func EmptyOrderedMap

func EmptyOrderedMap[K cmp.Ordered, V any]() OrderedMap[K, V]

func (OrderedMap[K, V]) Del

func (m OrderedMap[K, V]) Del(key K) OrderedMap[K, V]

func (OrderedMap[K, V]) Get

func (m OrderedMap[K, V]) Get(key K) (V, bool)

func (OrderedMap[K, V]) Iter

func (m OrderedMap[K, V]) Iter(f func(K, V) bool)

func (OrderedMap[K, V]) Len

func (m OrderedMap[K, V]) Len() int

func (OrderedMap[K, V]) Max

func (m OrderedMap[K, V]) Max() (K, V)

func (OrderedMap[K, V]) Min

func (m OrderedMap[K, V]) Min() (K, V)

func (OrderedMap[K, V]) Repr

func (m OrderedMap[K, V]) Repr() map[K]V

func (OrderedMap[K, V]) Set

func (m OrderedMap[K, V]) Set(key K, val V) OrderedMap[K, V]

func (OrderedMap[K, V]) Split

func (m OrderedMap[K, V]) Split(key K) (OrderedMap[K, V], OrderedMap[K, V])

Jump to

Keyboard shortcuts

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