LocalField
Stay organized with collections
Save and categorize content based on your preferences.
A field represents one dimension of a data type. It defines the name and format of
data.
This class contains constants representing the field names of common data types, each
prefixed with FIELD_
. These can be used to access the fields via LocalDataPoint.getValue(LocalField)
.
Constant Summary
int |
FORMAT_FLOAT
|
Format constant indicating the field holds float
values. |
int |
FORMAT_INT32
|
Format constant indicating the field holds
integer values. |
Public Method Summary
boolean |
|
int |
getFormat
() Returns the format of the field, as one of the format constant values.
|
String
|
getName
() Returns the name of the field.
|
int |
|
String
|
|
Inherited Method Summary
From class java.lang.Object
Constants
Format constant indicating the field holds float values.
Constant Value:
2
Format constant indicating the field holds integer values.
Constant Value:
1
Fields
public static final LocalField
FIELD_CALORIES
public static final LocalField
FIELD_DISTANCE
public static final LocalField
FIELD_STEPS
Public Methods
public boolean
equals
( Object
other)
Returns the format of the field, as one of the format constant values.
public String
getName
()
Returns the name of the 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eLocalField\u003c/code\u003e represents a single dimension of a data type, defining its name and format.\u003c/p\u003e\n"],["\u003cp\u003eIt includes predefined fields like \u003ccode\u003eFIELD_CALORIES\u003c/code\u003e, \u003ccode\u003eFIELD_DISTANCE\u003c/code\u003e, and \u003ccode\u003eFIELD_STEPS\u003c/code\u003e for common data types.\u003c/p\u003e\n"],["\u003cp\u003eData format is specified using constants like \u003ccode\u003eFORMAT_FLOAT\u003c/code\u003e and \u003ccode\u003eFORMAT_INT32\u003c/code\u003e, accessible via \u003ccode\u003egetFormat()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eLocalDataPoint.getValue(LocalField)\u003c/code\u003e can be used to access the values associated with these fields.\u003c/p\u003e\n"],["\u003cp\u003eMethods like \u003ccode\u003egetName()\u003c/code\u003e and \u003ccode\u003egetFormat()\u003c/code\u003e provide information about the field's properties.\u003c/p\u003e\n"]]],[],null,["# LocalField\n\npublic final class **LocalField** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nA field represents one dimension of a data type. It defines the name and format of\ndata.\n\nThis class contains constants representing the field names of common data types, each\nprefixed with `FIELD_`. These can be used to access the fields via [LocalDataPoint.getValue(LocalField)](/android/reference/com/google/android/gms/fitness/data/LocalDataPoint#getValue(com.google.android.gms.fitness.data.LocalField)). \n\n### Constant Summary\n\n|-----|------------------------------------------------------------------------------------------------|------------------------------------------------------------|\n| int | [FORMAT_FLOAT](/android/reference/com/google/android/gms/fitness/data/LocalField#FORMAT_FLOAT) | Format constant indicating the field holds float values. |\n| int | [FORMAT_INT32](/android/reference/com/google/android/gms/fitness/data/LocalField#FORMAT_INT32) | Format constant indicating the field holds integer values. |\n\n### Field Summary\n\n|-----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|-----------------------|\n| public static final [LocalField](/android/reference/com/google/android/gms/fitness/data/LocalField) | [FIELD_CALORIES](/android/reference/com/google/android/gms/fitness/data/LocalField#FIELD_CALORIES) | Calories in kcal. |\n| public static final [LocalField](/android/reference/com/google/android/gms/fitness/data/LocalField) | [FIELD_DISTANCE](/android/reference/com/google/android/gms/fitness/data/LocalField#FIELD_DISTANCE) | A distance in meters. |\n| public static final [LocalField](/android/reference/com/google/android/gms/fitness/data/LocalField) | [FIELD_STEPS](/android/reference/com/google/android/gms/fitness/data/LocalField#FIELD_STEPS) | A count of steps. |\n\n### Public Method Summary\n\n|-------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/android/gms/fitness/data/LocalField#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) other) |\n| int | [getFormat](/android/reference/com/google/android/gms/fitness/data/LocalField#getFormat())() Returns the format of the field, as one of the format constant values. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getName](/android/reference/com/google/android/gms/fitness/data/LocalField#getName())() Returns the name of the field. |\n| int | [hashCode](/android/reference/com/google/android/gms/fitness/data/LocalField#hashCode())() |\n| [String](//developer.android.com/reference/java/lang/String.html) | [toString](/android/reference/com/google/android/gms/fitness/data/LocalField#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\nConstants\n---------\n\n#### public static final int\n**FORMAT_FLOAT**\n\nFormat constant indicating the field holds float values. \nConstant Value: 2 \n\n#### public static final int\n**FORMAT_INT32**\n\nFormat constant indicating the field holds integer values. \nConstant Value: 1\n\nFields\n------\n\n#### public static final LocalField\n**FIELD_CALORIES**\n\nCalories in kcal.\n\nFormat is [FORMAT_FLOAT](/android/reference/com/google/android/gms/fitness/data/LocalField#FORMAT_FLOAT). \n\n#### public static final LocalField\n**FIELD_DISTANCE**\n\nA distance in meters.\n\nFormat is [FORMAT_FLOAT](/android/reference/com/google/android/gms/fitness/data/LocalField#FORMAT_FLOAT). \n\n#### public static final LocalField\n**FIELD_STEPS**\n\nA count of steps.\n\nFormat is [FORMAT_INT32](/android/reference/com/google/android/gms/fitness/data/LocalField#FORMAT_INT32).\n\nPublic Methods\n--------------\n\n#### public boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) other)\n\n#### public int **getFormat** ()\n\nReturns the format of the field, as one of the format constant values. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getName** ()\n\nReturns the name of the field. \n\n#### public int **hashCode** ()\n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **toString** ()"]]