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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
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 value of this object as a string.
| |||||||||||
Clears any value currently associated with the given
key in the map. | |||||||||||
Returns the format of this value, which matches the appropriate field in the
data type definition. | |||||||||||
Returns the value of the given key in the map as a
Float . | |||||||||||
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.
| |||||||||||
Updates the value for a given key in the map to the given float value.
| |||||||||||
Updates this value object to represent a string 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.
Returns | |
---|---|
String |
one of the constants from FitnessActivities ;
UNKNOWN if the object does not hold a valid activity representation |
Throws | |
---|---|
IllegalStateException |
if the object does not hold an int value |
Returns the value of this object as a float.
Returns | |
---|---|
float |
Throws | |
---|---|
IllegalStateException |
if the object does not hold an float value |
Returns the value of this object as an int.
Returns | |
---|---|
int |
Throws | |
---|---|
IllegalStateException |
if the object does not hold an int value |
Returns the value of this object as a string.
Returns | |
---|---|
String |
Throws | |
---|---|
IllegalStateException |
if the object does not hold a string value |
Clears any value currently associated with the given key
in the map. This method can
be used only on map
values.
Parameters | |
---|---|
key |
String :
the key we're modifying
|
Parameters | |
---|---|
o |
Object
|
Returns | |
---|---|
boolean |
Returns the value of the given key in the map as a Float
.
Parameters | |
---|---|
key |
String
|
Returns | |
---|---|
Float |
null if the key doesn't have a set value in the map
|
Throws | |
---|---|
IllegalStateException |
if the object does not hold a map value |
Returns | |
---|---|
int |
Returns true
if this object's value has been set by calling one of the setters.
Returns | |
---|---|
boolean |
Updates this value object to represent an activity
value.
Activities are internally represented as integers for storage.
Parameters | |
---|---|
activity |
String :
one of the activities from FitnessActivities
|
Updates this value object to represent a float value. Any previous values associated with this object are erased.
Parameters | |
---|---|
value |
float :
the new value that this objects holds
|
Updates this value object to represent an int value. Any previous values are erased.
Parameters | |
---|---|
value |
int :
the new value that this object holds
|
Updates the value for a given key in the map to the given float value. Any previous
values associated with the key are erased. This method can be used only on
map
values.
Key values should be kept small whenever possible. This is specially important for high frequency streams, since large keys may result in down sampling.
Parameters | |
---|---|
key |
String :
the key we're modifying |
value |
float :
the new value for the given key
|
Updates this value object to represent a string value. Any previous values associated with this object are erased.
String values should be kept small whenever possible. This is specially important for high frequency streams, since large values may result in down sampling.
Parameters | |
---|---|
value |
String :
the new value that this objects holds
|
Returns | |
---|---|
String |
Parameters | |
---|---|
dest |
Parcel
|
flags |
int
|