public enum HealthAggregationStyle

  1. Object
  2. Enum<HealthAggregationStyle>
  3. HealthAggregationStyle

ImplementsComparable<HealthAggregationStyle>

How a HealthDataType combines over a time bucket. Determines which AggregateMetric values are meaningful for the type.

Enum constants

CUMULATIVEValues accumulate over an interval and are summed – steps, distance, energy burned.
DISCRETEValues are point-in-time observations that are averaged or reduced – heart rate, body mass, blood glucose.
NONEThe type does not aggregate numerically at all – sleep sessions, workouts, category observations.

Methods

public static HealthAggregationStyle[] values()
public static HealthAggregationStyle valueOf(String name)

Inherited methods

Enum constant details

CUMULATIVE

CUMULATIVE

Values accumulate over an interval and are summed – steps, distance, energy burned. AggregateMetric.TOTAL is meaningful; averaging raw samples is not.

Cumulative types are always interval samples: a step count belongs to a span of time, never to an instant. See HealthDataType.isIntervalOnly().

DISCRETE

DISCRETE
Values are point-in-time observations that are averaged or reduced – heart rate, body mass, blood glucose. AggregateMetric.AVERAGE, AggregateMetric.MINIMUM, AggregateMetric.MAXIMUM and AggregateMetric.LATEST are meaningful; totalling them is not.

NONE

NONE
The type does not aggregate numerically at all – sleep sessions, workouts, category observations. Only AggregateMetric.COUNT and AggregateMetric.DURATION apply.

Method details

values

public static HealthAggregationStyle[] values()

valueOf

public static HealthAggregationStyle valueOf(String name)