Holder object for the value of a singlefield
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 viasetFloat(float)
and read viaasFloat()
.
Formats are defined as constants inField
Inherited Constant Summary
Public Method Summary
String |
asActivity()
Returns the value of this object as an activity.
|
float |
asFloat()
Returns the value of this object as a float.
|
int |
asInt()
Returns the value of this object as an int.
|
String |
asString()
Returns the value of this object as a string.
|
void |
clearKey(Stringkey)
This method is deprecated. Use
DataPoint.Builder to construct newDataPoint
instances.
|
boolean | |
int | |
Float | |
int |
hashCode()
|
boolean |
isSet()
Returns
true if this object's value has been set by calling one of
the setters.
|
void |
setActivity(Stringactivity)
This method is deprecated. Use
DataPoint.Builder to construct newDataPoint
instances.
|
void |
setFloat(float value)
This method is deprecated. Use
DataPoint.Builder to construct newDataPoint
instances.
|
void |
setInt(int
value)
This method is deprecated. Use
DataPoint.Builder to construct newDataPoint
instances.
|
void |
setKeyValue(Stringkey, float
value)
This method is deprecated. Use
DataPoint.Builder to construct newDataPoint
instances.
|
void |
setString(Stringvalue)
This method is deprecated. Use
DataPoint.Builder to construct newDataPoint
instances.
|
String |
toString()
|
void |
writeToParcel(Parceldest, int
flags)
|
Inherited Method Summary
Public Methods
publicStringasActivity()
Returns the value of this object as an activity. The integer representation of the activity is converted to a String prior to returning.
Returns
- One of the constants from
FitnessActivities
;FitnessActivities.UNKNOWN
if the object does not hold a valid activity representation
Throws
IllegalStateException | If thisValue
does not correspond to aField.FORMAT_INT32 |
---|
public floatasFloat()
Returns the value of this object as a float.
Throws
IllegalStateException | If thisValue
does not correspond to aField.FORMAT_FLOAT |
---|
public intasInt()
Returns the value of this object as an int.
Throws
IllegalStateException | If thisValue
does not correspond toField.FORMAT_INT32 |
---|
publicStringasString()
Returns the value of this object as a string.
Throws
IllegalStateException | If thisValue
does not correspond to aField.FORMAT_STRING |
---|
public voidclearKey(Stringkey)
This method is deprecated.
UseDataPoint.Builder
to construct newDataPoint
instances.
Clears any value currently associated with the givenkey
in the map.
This method can be used only onmap
values.
Parameters
key | The key you're modifying. |
---|
public booleanequals(Objectother)
public intgetFormat()
publicFloatgetKeyValue(Stringkey)
Returns the value of the given key in the map as aFloat
.
Returns
null
if the key doesn't have a set value in the map.
Throws
IllegalStateException | If thisValue
does not correspond to aField.FORMAT_MAP |
---|
public inthashCode()
public booleanisSet()
Returnstrue
if this object's value has been set by calling one of the
setters.
public voidsetActivity(Stringactivity)
This method is deprecated.
UseDataPoint.Builder
to construct newDataPoint
instances.
Updates this value object to represent anactivity
value. Activities are internally represented as integers for storage.
Parameters
activity | One of the activities fromFitnessActivities |
---|
public voidsetFloat(float value)
This method is deprecated.
UseDataPoint.Builder
to construct newDataPoint
instances.
Updates this value object to represent a float value. Any previous values associated with this object are erased.
Parameters
value | The new value that this objects holds. |
---|
public voidsetInt(int value)
This method is deprecated.
UseDataPoint.Builder
to construct newDataPoint
instances.
Updates this value object to represent an int value. Any previous values are erased.
Parameters
value | The new value that this object holds. |
---|
public voidsetKeyValue(Stringkey, float value)
This method is deprecated.
UseDataPoint.Builder
to construct newDataPoint
instances.
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 | The key you're modifying. |
---|---|
value | The new value for the given key. |
public voidsetString(Stringvalue)
This method is deprecated.
UseDataPoint.Builder
to construct newDataPoint
instances.
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 | The new value that this objects holds. |
---|