Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Class Info |
|---|
public class Group implements Parcelable Grouped data class, which represents a data group obtained by the user when querying the grouped data. For example, the user can query the grouped weight data collected within a period of time to learn about the maximum, minimum, and average body weight over this period of time. Currently, data can be grouped by time, activity record, activity type, or activity fragment. |
Qualifier and Type | Field and Description |
|---|---|
static final int | Groups data by time. |
static final int | Groups data by interval. |
Constructor Name |
|---|
Group(long startTime, long endTime, ActivityRecord activityRecord, int activityType, List<SampleSet> sampleSets, int groupType, boolean hasMoreSample) Builder for Group. |
Qualifier and Type | Method Name and Description |
|---|---|
String | Obtains the activity. |
| Obtains the activity record if data is grouped by activity record. Otherwise, null is returned. | |
final int | Obtains the activity type. |
long | getEndTime(TimeUnit timeUnit) Obtains the end time. |
int | Returns the group type. |
static String | getGroupTypeString(int groupType) Obtains the name of the group type. |
getSampleSet(DataType dataType) Returns the sampling dataset based on data type within the grouping time duration. | |
List<SampleSet> | Returns the sampling datasets within the grouping time duration. |
long | getStartTime(TimeUnit timeUnit) Obtains the start time. |
final boolean | Checks whether the server has more data. |
final boolean | hasSameSample(Group group) Checks whether the group has the same structure. |
Field |
|---|
public static final int TYPE_TIME Type constant, requesting data to be grouped by time. Constant value: 1 |
Field |
|---|
public static final int TYPE_INTERVALS Type constant, requesting data to be grouped by interval. Constant value: 5 |
Constructor |
|---|
public Group(long startTime, long endTime, ActivityRecord activityRecord, int activityType, List<SampleSet> sampleSets, int groupType, boolean hasMoreSample) Builder for Group. |
Parameters
Name | Description |
|---|---|
startTime | Start time. |
endTime | End time. |
activityRecord | Activity record. |
activityType | Activity type. |
sampleSets | Sampling datasets. |
groupType | Group type. |
hasMoreSample | Whether there is more data to be transferred. |
Method |
|---|
public String getActivity() Obtains the activity. |
Returns
Type | Description |
|---|---|
String | Activity type as a string. |
Method |
|---|
public ActivityRecord getActivityRecord() Obtains the activity record if data is grouped by activity record. Otherwise, null is returned. |
Returns
Type | Description |
|---|---|
Activity record. |
Method |
|---|
public final int getActivityType() Obtains the activity type. |
Returns
Type | Description |
|---|---|
int | Activity type. |
Method |
|---|
public long getEndTime(TimeUnit timeUnit) Returns the end time. |
Parameters
Name | Description |
|---|---|
timeUnit | Time unit. |
Returns
Type | Description |
|---|---|
long | End time. |
Method |
|---|
public int getGroupType() Returns the group type. |
Returns
Type | Description |
|---|---|
int | Group type. |
Method |
|---|
public static String getGroupTypeString(int groupType) Obtains the name of the group type. |
Parameters
Name | Description |
|---|---|
groupType | Group type. |
Returns
Type | Description |
|---|---|
String | Name of the group type. |
Parameters
Name | Description |
|---|---|
dataType | Data type. |
Returns
Type | Description |
|---|---|
SampleSet | Sampling dataset. |
Method |
|---|
public List<SampleSet> getSampleSets() Returns the sampling datasets within the grouping time duration. |
Returns
Type | Description |
|---|---|
List<SampleSet> | Sampling dataset. |
Method |
|---|
public long getStartTime(TimeUnit timeUnit) Returns the start time. |
Parameters
Name | Description |
|---|---|
timeUnit | Time unit. |
Returns
Type | Description |
|---|---|
long | Start time. |
Method |
|---|
public final boolean hasMoreSample() Checks whether the server has more data to transfer. |
Returns
Type | Description |
|---|---|
boolean | Whether the server has more data to transfer. |
Method |
|---|
public final boolean hasSameSample(Group group) Checks whether the group has the same structure. |
Parameters
Name | Description |
|---|---|
group | Grouped data class. |
Returns
Type | Description |
|---|---|
boolean | Whether the group has the same structure. |