rankedlist

package
v0.0.0-...-225fc4e Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item[R container.Comparer[R], T any] struct {
	// contains filtered or unexported fields
}

func (*Item[R, T]) Present

func (it *Item[R, T]) Present() bool

func (*Item[R, T]) Rank

func (it *Item[R, T]) Rank() R

func (*Item[R, T]) Value

func (it *Item[R, T]) Value() *T

type List

type List[R container.Comparer[R], T any] struct {
	// contains filtered or unexported fields
}

func New

func New[R container.Comparer[R], T any]() *List[R, T]

func (*List[R, T]) All

func (h *List[R, T]) All() iter.Seq[*Item[R, T]]

func (*List[R, T]) Clear

func (h *List[R, T]) Clear()

func (*List[R, T]) Delete

func (h *List[R, T]) Delete(item *Item[R, T])

func (*List[R, T]) DeleteFirst

func (h *List[R, T]) DeleteFirst()

func (*List[R, T]) First

func (h *List[R, T]) First() *Item[R, T]

func (*List[R, T]) Insert

func (h *List[R, T]) Insert(rank R) *Item[R, T]

func (*List[R, T]) Len

func (h *List[R, T]) Len() int

func (*List[R, T]) Random

func (h *List[R, T]) Random(rnd *rand.Rand) *Item[R, T]

func (*List[R, T]) RemoveOrdered

func (h *List[R, T]) RemoveOrdered() iter.Seq[*Item[R, T]]

func (*List[R, T]) SetRank

func (h *List[R, T]) SetRank(item *Item[R, T], rank R)

Jump to

Keyboard shortcuts

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