public final class CategorySample
- Object
- HealthSample
- CategorySample
An enumerated observation with no natural unit – menstrual flow, for example.
The value is a small integer whose meaning depends on the type. Use the constants each type documents rather than raw numbers; the ports map them onto the platform’s own encoding.
Fields
public static final int FLOW_UNSPECIFIED = 1 | HealthDataType.MENSTRUATION_FLOW: the platform reported a flow but not its intensity. |
public static final int FLOW_LIGHT = 2 | HealthDataType.MENSTRUATION_FLOW: light flow. |
public static final int FLOW_MEDIUM = 3 | HealthDataType.MENSTRUATION_FLOW: medium flow. |
public static final int FLOW_HEAVY = 4 | HealthDataType.MENSTRUATION_FLOW: heavy flow. |
Methods
public static CategorySample create(HealthDataType type, int value, long instantMillis) | An instantaneous observation. |
public static CategorySample create(HealthDataType type, int value, long startMillis, long endMillis) | An observation spanning an interval. |
public int getValue() | The enumerated value, interpreted per this sample’s type. |
public String toString() | Returns a string representation of the object. |
Inherited methods
Field details
FLOW_UNSPECIFIED
public static final int FLOW_UNSPECIFIED = 1HealthDataType.MENSTRUATION_FLOW: the platform reported a flow
but not its intensity.FLOW_LIGHT
public static final int FLOW_LIGHT = 2HealthDataType.MENSTRUATION_FLOW: light flow.FLOW_MEDIUM
public static final int FLOW_MEDIUM = 3HealthDataType.MENSTRUATION_FLOW: medium flow.FLOW_HEAVY
public static final int FLOW_HEAVY = 4HealthDataType.MENSTRUATION_FLOW: heavy flow.Method details
create
public static CategorySample create(HealthDataType type, int value, long instantMillis)An instantaneous observation.
create
public static CategorySample create(HealthDataType type, int value, long startMillis, long endMillis)An observation spanning an interval.
getValue
public int getValue()The enumerated value, interpreted per this sample’s type.
toString
public String toString()Returns a string representation of the object. In general, the toString method returns a string that “textually represents” this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.
The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@’, and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:
getClass().getName() + ‘@’ + Integer.toHexString(hashCode())