Class CategorySample
java.lang.Object
com.codename1.health.HealthSample
com.codename1.health.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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intHealthDataType.MENSTRUATION_FLOW: heavy flow.static final intHealthDataType.MENSTRUATION_FLOW: light flow.static final intHealthDataType.MENSTRUATION_FLOW: medium flow.static final intHealthDataType.MENSTRUATION_FLOW: the platform reported a flow but not its intensity. -
Method Summary
Modifier and TypeMethodDescriptionstatic CategorySamplecreate(HealthDataType type, int value, long instantMillis) An instantaneous observation.static CategorySamplecreate(HealthDataType type, int value, long startMillis, long endMillis) An observation spanning an interval.intgetValue()The enumerated value, interpreted per this sample's type.toString()Returns a string representation of the object.Methods inherited from class HealthSample
equals, getDurationMillis, getEndMillis, getId, getMetadata, getRecordingMethod, getSource, getStartMillis, getType, hashCode, isInstantaneous, putMetadata, setId, setRecordingMethod, setSource
-
Field Details
-
FLOW_UNSPECIFIED
public static final int FLOW_UNSPECIFIEDHealthDataType.MENSTRUATION_FLOW: the platform reported a flow but not its intensity.- See Also:
-
FLOW_LIGHT
-
FLOW_MEDIUM
-
FLOW_HEAVY
-
-
Method Details
-
create
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
Description copied from class:ObjectReturns 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())- Overrides:
toStringin classHealthSample
-