LocalDataPoint
Stay organized with collections
Save and categorize content based on your preferences.
Represents a single data point in a LocalDataType
's
stream. A data point holds a value for each field and a time interval. The exact semantics of
each of these attributes is specified in the documentation for the particular data type,
which can be found in the appropriate constant in LocalDataType
.
A data point can represent a instantaneous reading as well as aggregates over a time
interval. Check the data type documentation to determine which is the case for a particular
data type.
LocalDataPoint
s always contain one value for each data type LocalField
.
Public Method Summary
boolean |
|
LocalDataType
|
getDataType()
Returns the data type defining the format of the values in this data point.
|
long |
getEndTime( TimeUnit
timeUnit)
Returns the end time of the interval represented by this data point, in the
given unit since epoch.
|
long |
getStartTime( TimeUnit
timeUnit)
Returns the start time of the interval represented by this data point, in the
given unit since epoch.
|
LocalValue
|
|
int |
|
String
|
|
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Methods
public boolean equals (Object other)
Returns the data type defining the format of the values in this data point.
public long getEndTime (TimeUnit
timeUnit)
Returns the end time of the interval represented by this data point, in the given
unit since epoch.
public long getStartTime (TimeUnit
timeUnit)
Returns the start time of the interval represented by this data point, in the given
unit since epoch.
Returns the value holder for the field with the given name. This method can be used
both to query the value and to set it.
Parameters
field |
One of the fields of this data type. |
Returns
- The value associated with the given field.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eLocalDataPoint\u003c/code\u003e represents a single data point in a fitness data stream, holding values for each field and a time interval.\u003c/p\u003e\n"],["\u003cp\u003eData points can represent instantaneous readings or aggregates over a time interval, depending on the associated data type.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eLocalDataPoint\u003c/code\u003e objects contain one value for each field defined in the \u003ccode\u003eLocalDataType\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eKey methods include \u003ccode\u003egetDataType()\u003c/code\u003e, \u003ccode\u003egetEndTime()\u003c/code\u003e, \u003ccode\u003egetStartTime()\u003c/code\u003e, and \u003ccode\u003egetValue()\u003c/code\u003e to access data point information.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetValue()\u003c/code\u003e allows retrieving or setting the value associated with a specific field within the data point.\u003c/p\u003e\n"]]],[],null,["# LocalDataPoint\n\npublic final class **LocalDataPoint** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nRepresents a single data point in a [LocalDataType](/android/reference/com/google/android/gms/fitness/data/LocalDataType)'s\nstream. A data point holds a value for each field and a time interval. The exact semantics of\neach of these attributes is specified in the documentation for the particular data type,\nwhich can be found in the appropriate constant in [LocalDataType](/android/reference/com/google/android/gms/fitness/data/LocalDataType).\n\nA data point can represent a instantaneous reading as well as aggregates over a time\ninterval. Check the data type documentation to determine which is the case for a particular\ndata type.\n\n`LocalDataPoint`s always contain one value for each data type [LocalField](/android/reference/com/google/android/gms/fitness/data/LocalField). \n\n### Public Method Summary\n\n|---------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/android/gms/fitness/data/LocalDataPoint#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) other) |\n| [LocalDataType](/android/reference/com/google/android/gms/fitness/data/LocalDataType) | [getDataType](/android/reference/com/google/android/gms/fitness/data/LocalDataPoint#getDataType())() Returns the data type defining the format of the values in this data point. |\n| long | [getEndTime](/android/reference/com/google/android/gms/fitness/data/LocalDataPoint#getEndTime(java.util.concurrent.TimeUnit))([TimeUnit](//developer.android.com/reference/java/util/concurrent/TimeUnit.html) timeUnit) Returns the end time of the interval represented by this data point, in the given unit since epoch. |\n| long | [getStartTime](/android/reference/com/google/android/gms/fitness/data/LocalDataPoint#getStartTime(java.util.concurrent.TimeUnit))([TimeUnit](//developer.android.com/reference/java/util/concurrent/TimeUnit.html) timeUnit) Returns the start time of the interval represented by this data point, in the given unit since epoch. |\n| [LocalValue](/android/reference/com/google/android/gms/fitness/data/LocalValue) | [getValue](/android/reference/com/google/android/gms/fitness/data/LocalDataPoint#getValue(com.google.android.gms.fitness.data.LocalField))([LocalField](/android/reference/com/google/android/gms/fitness/data/LocalField) field) Returns the value holder for the field with the given name. |\n| int | [hashCode](/android/reference/com/google/android/gms/fitness/data/LocalDataPoint#hashCode())() |\n| [String](//developer.android.com/reference/java/lang/String.html) | [toString](/android/reference/com/google/android/gms/fitness/data/LocalDataPoint#toString())() |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods\n--------------\n\n#### public boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) other)\n\n#### public [LocalDataType](/android/reference/com/google/android/gms/fitness/data/LocalDataType)\n**getDataType** ()\n\nReturns the data type defining the format of the values in this data point. \n\n#### public long **getEndTime** ([TimeUnit](//developer.android.com/reference/java/util/concurrent/TimeUnit.html) timeUnit)\n\nReturns the end time of the interval represented by this data point, in the given\nunit since epoch. \n\n#### public long **getStartTime** ([TimeUnit](//developer.android.com/reference/java/util/concurrent/TimeUnit.html) timeUnit)\n\nReturns the start time of the interval represented by this data point, in the given\nunit since epoch. \n\n#### public [LocalValue](/android/reference/com/google/android/gms/fitness/data/LocalValue)\n**getValue** ([LocalField](/android/reference/com/google/android/gms/fitness/data/LocalField) field)\n\nReturns the value holder for the field with the given name. This method can be used\nboth to query the value and to set it. \n\n##### Parameters\n\n| field | One of the fields of this data type. |\n|-------|--------------------------------------|\n\n##### Returns\n\n- The value associated with the given field. \n\n##### Throws\n\n| [IllegalArgumentException](//developer.android.com/reference/java/lang/IllegalArgumentException.html) | If the given field doesn't match any of the fields for this data point's data type. |\n|-------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|\n\n#### public int **hashCode** ()\n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **toString** ()"]]