java.lang.Object | |
↳ | com.google.android.gms.fitness.data.Value |
Holder object for the value of a single field
in a data point
.
Values are not constructed directly; a value for each field of the data type
is created for each data point.
A field value has a particular format, and should be set and read using the
format-specific methods. For instance, a float value should be set via setFloat(float)
and read via asFloat()
.
Formats are defined as constants in Field
[Expand]
Inherited Constants | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]()
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the value of this object as an activity.
| |||||||||||
Returns the value of this object as a float.
| |||||||||||
Returns the value of this object as an int.
| |||||||||||
Returns the format of this value, which matches the appropriate field in the
data type definition.
| |||||||||||
Returns
true if this object's value has been set by calling one of the setters.
| |||||||||||
Updates this value object to represent an
activity value.
| |||||||||||
Updates this value object to represent a float value.
| |||||||||||
Updates this value object to represent an int value.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||||||||||||||||||||||||
![]() |
Returns the value of this object as an activity. The integer representation of the activity is converted to a String prior to returning.
FitnessActivities
;
UNKNOWN
if the object does not hold a valid activity representationIllegalStateException | if the object does not hold an int value |
---|
Returns the value of this object as a float.
IllegalStateException | if the object does not hold an float value |
---|
Returns the value of this object as an int.
IllegalStateException | if the object does not hold an int value |
---|
Returns true
if this object's value has been set by calling one of the setters.
Updates this value object to represent an activity
value.
Activities are internally represented as integers for storage.
activity | one of the activities from FitnessActivities
|
---|
Updates this value object to represent a float value. Any previous values associated with this object are erased.
value | the new value that this objects holds |
---|
Updates this value object to represent an int value. Any previous values are erased.
value | the new value that this object holds |
---|