algorithm

package
v0.0.0-...-4ee4993 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyTimeIntervalSet = TimeIntervalSet{}
View Source
var FullTimeIntervalSet = TimeIntervalSet{UnboundedBelow: true}

Functions

This section is empty.

Types

type TimeIntervalSet

type TimeIntervalSet struct {
	UnboundedBelow bool
	ChangePoints   []time.Time
}

func IntersectTimeIntervalSets

func IntersectTimeIntervalSets(sets ...TimeIntervalSet) TimeIntervalSet

func MergeTimeIntervalSets

func MergeTimeIntervalSets(left TimeIntervalSet, right TimeIntervalSet, predicate func(testpoint time.Time) bool) TimeIntervalSet

MergeTimeIntervalSets creates a new TimeIntervalSet from two other TimeIntervalSets. The predicate function is called on various test points derived from the input sets and should return true if the testpoint should be in the resulting set.

func NewTimeInterval

func NewTimeInterval(start time.Time, end time.Time) TimeIntervalSet

NewTimeInterval returns a TimeIntervalSet for the left-closed, right-open range [start, end)

func UnionTimeIntervalSets

func UnionTimeIntervalSets(sets ...TimeIntervalSet) TimeIntervalSet

func (TimeIntervalSet) Complement

func (tis TimeIntervalSet) Complement() TimeIntervalSet

func (TimeIntervalSet) Contains

func (tis TimeIntervalSet) Contains(point time.Time) bool

func (TimeIntervalSet) String

func (tis TimeIntervalSet) String() string

func (TimeIntervalSet) TotalDuration

func (tis TimeIntervalSet) TotalDuration() time.Duration

Jump to

Keyboard shortcuts

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