TimeIntervalCollection

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
object Companion
Link copied to clipboard
sealed interface FindIntervalOptions

Properties

Link copied to clipboard

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

Link copied to clipboard

Gets whether or not the collection is empty.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
val length: Int

Gets the number of intervals in the collection.

Link copied to clipboard

Gets the start time of the collection.

Link copied to clipboard

Gets the stop time of the collection.

Functions

Link copied to clipboard
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
fun contains(julianDate: JulianDate): Boolean

Checks if the specified date is inside this collection.

Link copied to clipboard
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

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
operator fun get(index: Int): TimeInterval?

Gets the interval at the specified index.

Link copied to clipboard
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
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
fun removeAll()

Removes all intervals from the collection.

Link copied to clipboard

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