# Class CategorySample

java.lang.Object
com.codename1.health.HealthSample
com.codename1.health.CategorySample

public final class CategorySample extends HealthSample

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

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `FLOW_HEAVY`
  `HealthDataType.MENSTRUATION_FLOW`: heavy flow.
  `static final int`
  `FLOW_LIGHT`
  `HealthDataType.MENSTRUATION_FLOW`: light flow.
  `static final int`
  `FLOW_MEDIUM`
  `HealthDataType.MENSTRUATION_FLOW`: medium flow.
  `static final int`
  `FLOW_UNSPECIFIED`
  `HealthDataType.MENSTRUATION_FLOW`: the platform reported a flow but not its intensity.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static CategorySample`
  `create(HealthDataType type, int value, long instantMillis)`
  An instantaneous observation.
  `static CategorySample`
  `create(HealthDataType type, int value, long startMillis, long endMillis)`
  An observation spanning an interval.
  `int`
  `getValue()`
  The enumerated value, interpreted per this sample's type.
  `String`
  `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`

  ### Methods inherited from class Object

  `clone, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### FLOW_UNSPECIFIED

    public static final int FLOW_UNSPECIFIED
    `HealthDataType.MENSTRUATION_FLOW`: the platform reported a flow but not its intensity.
    See Also:
      - Constant Field Values

  - ### FLOW_LIGHT

    public static final int FLOW_LIGHT
    `HealthDataType.MENSTRUATION_FLOW`: light flow.
    See Also:
      - Constant Field Values

  - ### FLOW_MEDIUM

    public static final int FLOW_MEDIUM
    `HealthDataType.MENSTRUATION_FLOW`: medium flow.
    See Also:
      - Constant Field Values

  - ### FLOW_HEAVY

    public static final int FLOW_HEAVY
    `HealthDataType.MENSTRUATION_FLOW`: heavy flow.
    See Also:
      - Constant Field Values

- ## 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()
    Description copied from class: `Object`
    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())
    Overrides:
      `toString` in class `HealthSample`