TimeSeries

class TimeSeries<Data>(data: HashMap<TimeIntervalKey, Data>? = null)

A class that represents a time series of data.

Constructors

Link copied to clipboard
constructor(data: HashMap<TimeIntervalKey, Data>? = null)

Properties

Link copied to clipboard
val count: Int

The number of entries in the time series.

Link copied to clipboard

The data associated with the time series.

Link copied to clipboard

The time intervals for the time series.

Link copied to clipboard

The time range covered by the time series.

Link copied to clipboard

The number of entries in the time series that contain valid data.

Functions

Link copied to clipboard
Link copied to clipboard

Returns the interval closest to the provided date within the time series.

Link copied to clipboard
fun dataAtIndex(index: Int): Data?

Returns the data associated with the specified index in the time series.

Link copied to clipboard

Returns the data associated with the specified interval in the time series.

Link copied to clipboard

Returns the data associated with the specified time interval in the time series.

Link copied to clipboard

Returns the time series entry for the specified interval if exists.

Link copied to clipboard
fun hasDataForInterval(interval: TimeInterval, checkValid: Boolean = false): Boolean

Returns whether the time series contains data for the specified time interval.

Link copied to clipboard

Returns the time interval at the specified index in the time series.

Link copied to clipboard
fun intervalsInRange(start: Date, end: Date, includeStops: Boolean = true): MutableList<TimeInterval>

Returns the time intervals within the specified range for the time series. If includeStops is true, then the start and end values will be allowed in the returned set of time intervals. Default is true.

Link copied to clipboard
fun intervalsNeedingData(intervals: List<TimeInterval> = this.intervals): List<TimeInterval>

Returns an array of time intervals that do not have data associated with them based on the passed array of intervals. If no intervals are provided, then the current intervals for the time series are used.

Link copied to clipboard

Clears the data associated with the time series.

Link copied to clipboard

Removes the time interval and associated data from the time series.

Link copied to clipboard

Sets the data for the time series.

Link copied to clipboard
Link copied to clipboard
fun setDataForInterval(interval: TimeInterval, data: Data?, createIfMissing: Boolean = false)

Sets the data for the specified time interval in the time series.