TimeIntervalCollection

open external class TimeIntervalCollection(intervals: ReadonlyArray<TimeInterval>? = definedExternally)(source)

A non-overlapping collection of TimeInterval instances sorted by start time.

Parameters

intervals

An array of intervals to add to the collection.

See also

Constructors

Link copied to clipboard
constructor(intervals: ReadonlyArray<TimeInterval>? = definedExternally)

Types

Link copied to clipboard
external object Companion
Link copied to clipboard
external interface FindIntervalOptions

Properties

Link copied to clipboard

Gets an event that is raised whenever the collection of intervals change.

Link copied to clipboard
external val isEmpty: Boolean

Gets whether or not the collection is empty.

Link copied to clipboard
external val isStartIncluded: Boolean

Gets whether or not the start time is included in the collection.

Link copied to clipboard
external val isStopIncluded: Boolean

Gets whether or not the stop time is included in the collection.

Link copied to clipboard
external val length: Int

Gets the number of intervals in the collection.

Link copied to clipboard
external val start: JulianDate

Gets the start time of the collection.

Link copied to clipboard
external val stop: JulianDate

Gets the stop time of the collection.

Functions

Link copied to clipboard
external fun addInterval(interval: TimeInterval, dataComparer: DataComparer? = definedExternally)

Adds an interval to the collection, merging intervals that contain the same data and splitting intervals of different data as needed in order to maintain a non-overlapping collection. The data in the new interval takes precedence over any existing intervals in the collection.

Link copied to clipboard
external fun contains(julianDate: JulianDate): Boolean

Checks if the specified date is inside this collection.

Link copied to clipboard
external fun equals(right: TimeIntervalCollection? = definedExternally, dataComparer: DataComparer? = definedExternally): Boolean

Compares this instance against the provided instance componentwise and returns true if they are equal, false otherwise.

Link copied to clipboard

Finds and returns the data for the interval that contains the specified date.

Link copied to clipboard
external fun findInterval(options: TimeIntervalCollection.FindIntervalOptions? = definedExternally): TimeInterval?

Returns the first interval in the collection that matches the specified parameters. All parameters are optional and undefined parameters are treated as a don't care condition.

Link copied to clipboard

Finds and returns the interval that contains the specified date.

Link copied to clipboard
external fun get(index: Int): TimeInterval?

Gets the interval at the specified index.

Link copied to clipboard
external fun indexOf(date: JulianDate): Int

Finds and returns the index of the interval in the collection that contains the specified date.

Link copied to clipboard
external fun intersect(other: TimeIntervalCollection, dataComparer: DataComparer? = definedExternally, mergeCallback: MergeCallback? = definedExternally): TimeIntervalCollection

Creates a new instance that is the intersection of this collection and the provided collection.

Link copied to clipboard
external fun removeAll()

Removes all intervals from the collection.

Link copied to clipboard
external fun removeInterval(interval: TimeInterval): Boolean

Removes the specified interval from this interval collection, creating a hole over the specified interval. The data property of the input interval is ignored.