SampleDataPoint


class SampleDataPoint<T : Any> : DataPoint


Data point that represents a piece of data that was valid at a single point in time, for example heart rate or speed.

Summary

Public constructors

<T : Any> SampleDataPoint(
    dataType: DataType<T, SampleDataPoint<T>>,
    value: T,
    timeDurationFromBoot: Duration,
    metadata: Bundle,
    accuracy: DataPointAccuracy?
)

Public functions

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

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

open Int

Public properties

DataPointAccuracy?

Accuracy of this DataPoint.

open DataType<T, SampleDataPoint<T>>

The DataType this DataPoint represents.

Bundle

OEM specific data.

Duration

The time this DataPoint represents.

T

The value of this data point.

Public constructors

SampleDataPoint

<T : Any> SampleDataPoint(
    dataType: DataType<T, SampleDataPoint<T>>,
    value: T,
    timeDurationFromBoot: Duration,
    metadata: Bundle = Bundle(),
    accuracy: DataPointAccuracy? = null
)

Public functions

equals

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

getTimeInstant

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

Returns the time 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-alpha05
open val dataTypeDataType<T, SampleDataPoint<T>>

The DataType 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.

timeDurationFromBoot

Added in 1.0.0
val timeDurationFromBootDuration

The time this DataPoint represents.

value

Added in 1.0.0
val value: T

The value of this data point.