IntervalDataPoint


class IntervalDataPoint<T : Any> : DataPoint


Data point that includes just the delta from the previous data point for dataType.

Summary

Public constructors

<T : Any> IntervalDataPoint(
    dataType: DataType<T, IntervalDataPoint<T>>,
    value: T,
    startDurationFromBoot: Duration,
    endDurationFromBoot: Duration,
    metadata: Bundle,
    accuracy: DataPointAccuracy?
)

Public functions

open operator Boolean
equals(other: Any?)
Instant
getEndInstant(bootInstant: Instant)

Returns the end Instant of this DataPoint, knowing the time at which the system booted.

Instant
getStartInstant(bootInstant: Instant)

Returns the start Instant of this DataPoint, knowing the time at which the system booted.

open Int

Public properties

DataPointAccuracy?

Accuracy of this DataPoint.

open DataType<T, IntervalDataPoint<T>>

The DataType this DataPoint represents.

Duration

The end of the time period this DataPoint represents.

Bundle

OEM specific data.

Duration

The beginning of the time period this DataPoint represents.

T

The value of this data point.

Public constructors

IntervalDataPoint

<T : Any> IntervalDataPoint(
    dataType: DataType<T, IntervalDataPoint<T>>,
    value: T,
    startDurationFromBoot: Duration,
    endDurationFromBoot: Duration,
    metadata: Bundle = Bundle(),
    accuracy: DataPointAccuracy? = null
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

getEndInstant

Added in 1.0.0
fun getEndInstant(bootInstant: Instant): Instant

Returns the end Instant of this DataPoint, knowing the time at which the system booted.

Parameters
bootInstant: Instant

the Instant at which the system booted, this can be computed by Instant.ofEpochMilli(System.currentTimeMillis() - SystemClock.elapsedRealtime())

getStartInstant

Added in 1.0.0
fun getStartInstant(bootInstant: Instant): Instant

Returns the start Instant of this DataPoint, knowing the time at which the system booted.

Parameters
bootInstant: Instant

the Instant at which the system booted, this can be computed by Instant.ofEpochMilli(System.currentTimeMillis() - SystemClock.elapsedRealtime())

hashCode

open fun hashCode(): Int

Public properties

accuracy

Added in 1.0.0
val accuracyDataPointAccuracy?

Accuracy of this DataPoint.

dataType

Added in 1.1.0-alpha02
open val dataTypeDataType<T, IntervalDataPoint<T>>

The DataType this DataPoint represents.

endDurationFromBoot

Added in 1.0.0
val endDurationFromBootDuration

The end of the time period this DataPoint represents.

metadata

Added in 1.0.0
val metadataBundle

OEM specific data. In general, this should not be relied upon by non-preloaded apps.

startDurationFromBoot

Added in 1.0.0
val startDurationFromBootDuration

The beginning of the time period this DataPoint represents.

value

Added in 1.0.0
val value: T

The value of this data point.