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 Details

  • 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