values

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2018 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderUnifiedCheckboxCombo added in v0.4.0

func RenderUnifiedCheckboxCombo(readOnly, multiple bool, label string, unifier Unifier, changeHandler func(bool))

RenderUnifiedCheckboxCombo renders a control for a unified boolean value.

func RenderUnifiedCombo added in v0.4.0

func RenderUnifiedCombo(readOnly, multiple bool, label string, unifier Unifier,
	intConverter func(Unifier) int, formatter func(int) string, count int, changeHandler func(int))

RenderUnifiedCombo renders a control for a unified enumeration value.

func RenderUnifiedSliderInt added in v0.4.0

func RenderUnifiedSliderInt(readOnly, multiple bool, label string, unifier Unifier,
	intConverter func(Unifier) int, formatter func(int) string, min, max int, changeHandler func(int))

RenderUnifiedSliderInt renders a control for an unified integer value.

Types

type Unifier

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

Unifier can be used to verify whether a list of values has equal entries.

func NewUnifier

func NewUnifier() Unifier

NewUnifier returns a new instance.

func (*Unifier) Add

func (u *Unifier) Add(value interface{})

Add unifies the given value to the current state. The given value must be comparable.

func (Unifier) IsUnique

func (u Unifier) IsUnique() bool

IsUnique returns true if the unifier has received only equal values.

func (*Unifier) Unified

func (u *Unifier) Unified() interface{}

Unified returns the result of the unification. If all values that were added to the unifier were equal, then the first added value will be returned. Otherwise, nil will be returned.

Jump to

Keyboard shortcuts

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