CumulativeDataPoint


public final class CumulativeDataPoint<T extends Number> extends DataPoint


A DataPoint containing a cumulative total for the type dataType between start and end. Unlike IntervalDataPoint, this is guaranteed to increase over time (assuming the same start value.) For example, an IntervalDataPoint for DataType.STEPS

Summary

Public constructors

<T extends Number> CumulativeDataPoint(
    @NonNull AggregateDataType<@NonNull T, @NonNull CumulativeDataPoint<@NonNull T>> dataType,
    @NonNull T total,
    @NonNull Instant start,
    @NonNull Instant end
)

Public methods

final @NonNull Instant

The end of the time period this DataPoint represents.

final @NonNull Instant

The beginning of the time period this DataPoint represents.

final @NonNull T

The accumulated value between start and end.

Inherited methods

From androidx.health.services.client.data.DataPoint
@NonNull DataType<@NonNull T, @NonNull DataPoint<@NonNull T>>

Type of data contained within this DataPoint.

Public constructors

CumulativeDataPoint

public <T extends Number> CumulativeDataPoint(
    @NonNull AggregateDataType<@NonNull T, @NonNull CumulativeDataPoint<@NonNull T>> dataType,
    @NonNull T total,
    @NonNull Instant start,
    @NonNull Instant end
)

Public methods

getEnd

Added in 1.0.0
public final @NonNull Instant getEnd()

The end of the time period this DataPoint represents.

getStart

Added in 1.0.0
public final @NonNull Instant getStart()

The beginning of the time period this DataPoint represents.

getTotal

Added in 1.0.0
public final @NonNullgetTotal()

The accumulated value between start and end.