rankingcoll

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRankingEntryListShouldHaveEvenLength              = errors.New(`flat rank entry list should have an even length: [<value>, <float>,  <value>, <float>]`)
	ErrRankingEntryListShouldHaveFloatScoresAtOddIndexes = errors.New(`flat rank entry list should have scores at odd indexes : [<value>, <float>,  <value>, <float>]`)
	ErrRankingCanOnlyContainValuesWithFastId             = errors.New("a Ranking can only contain values having a fast id")
	ErrRankingCanOnlyRankValuesWithAPositiveScore        = errors.New("a Ranking can only rank values with a positive score")
	ErrRankingCannotContainDuplicates                    = errors.New("a Ranking cannot contain duplicates")
)

Functions

This section is empty.

Types

type Rank

type Rank struct {
	// contains filtered or unexported fields
}

func (*Rank) Equal

func (r *Rank) Equal(ctx *core.Context, other core.Value, alreadyCompared map[uintptr]uintptr, depth int) bool

func (*Rank) GetGoMethod

func (r *Rank) GetGoMethod(name string) (*core.GoFunction, bool)

func (*Rank) IsMutable

func (r *Rank) IsMutable() bool

func (*Rank) PrettyPrint

func (r *Rank) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, parentIndentCount int)

func (*Rank) Prop

func (r *Rank) Prop(ctx *core.Context, name string) core.Value

func (*Rank) PropertyNames

func (*Rank) PropertyNames(ctx *core.Context) []string

func (*Rank) SetProp

func (*Rank) SetProp(ctx *core.Context, name string, value core.Value) error

func (*Rank) ToSymbolicValue

func (r *Rank) ToSymbolicValue(ctx *core.Context, encountered map[uintptr]symbolic.Value) (symbolic.Value, error)

type RankItem

type RankItem struct {
	// contains filtered or unexported fields
}

type Ranking

type Ranking struct {
	// contains filtered or unexported fields
}

func NewRanking

func NewRanking(ctx *core.Context, flatEntries *core.List) *Ranking

func (*Ranking) Add

func (r *Ranking) Add(ctx *core.Context, value core.Serializable, score core.Float)

func (*Ranking) Equal

func (r *Ranking) Equal(ctx *core.Context, other core.Value, alreadyCompared map[uintptr]uintptr, depth int) bool

func (*Ranking) GetGoMethod

func (f *Ranking) GetGoMethod(name string) (*core.GoFunction, bool)

func (*Ranking) IsMutable

func (r *Ranking) IsMutable() bool

func (*Ranking) Iterator

func (r *Ranking) Iterator(ctx *core.Context, config core.IteratorConfiguration) core.Iterator

func (*Ranking) PrettyPrint

func (r *Ranking) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, parentIndentCount int)

func (*Ranking) Prop

func (r *Ranking) Prop(ctx *core.Context, name string) core.Value

func (*Ranking) PropertyNames

func (*Ranking) PropertyNames(ctx *core.Context) []string

func (*Ranking) Remove

func (r *Ranking) Remove(ctx *core.Context, removedVal core.Serializable)

func (*Ranking) SetProp

func (*Ranking) SetProp(ctx *core.Context, name string, value core.Value) error

func (*Ranking) ToSymbolicValue

func (r *Ranking) ToSymbolicValue(ctx *core.Context, encountered map[uintptr]symbolic.Value) (symbolic.Value, error)

Jump to

Keyboard shortcuts

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