We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

Group

Expand

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.

Public Field Summary

Expand

Qualifier and Type

Field and Description

static final int

TYPE_TIME

Groups data by time.

static final int

TYPE_INTERVALS

Groups data by interval.

Public Constructor Summary

Expand

Constructor Name

Group(long startTime, long endTime, ActivityRecord activityRecord, int activityType, List<SampleSet> sampleSets, int groupType, boolean hasMoreSample)

Builder for Group.

Public Method Summary

Expand

Qualifier and Type

Method Name and Description

String

getActivity()

Obtains the activity.

ActivityRecord

getActivityRecord()

Obtains the activity record if data is grouped by activity record. Otherwise, null is returned.

final int

getActivityType()

Obtains the activity type.

long

getEndTime(TimeUnit timeUnit)

Obtains the end time.

int

getGroupType()

Returns the group type.

static String

getGroupTypeString(int groupType)

Obtains the name of the group type.

SampleSet

getSampleSet(DataType dataType)

Returns the sampling dataset based on data type within the grouping time duration.

List<SampleSet>

getSampleSets()

Returns the sampling datasets within the grouping time duration.

long

getStartTime(TimeUnit timeUnit)

Obtains the start time.

final boolean

hasMoreSample()

Checks whether the server has more data.

final boolean

hasSameSample(Group group)

Checks whether the group has the same structure.

Public Fields

TYPE_TIME

Expand

Field

public static final int TYPE_TIME

Type constant, requesting data to be grouped by time.

Constant value: 1

TYPE_INTERVALS

Expand

Field

public static final int TYPE_INTERVALS

Type constant, requesting data to be grouped by interval.

Constant value: 5

Public Constructors

public Group(long startTime, long endTime, ActivityRecord activityRecord, int activityType, List<SampleSet> sampleSets, int groupType, boolean hasMoreSample)

Expand

Constructor

public Group(long startTime, long endTime, ActivityRecord activityRecord, int activityType, List<SampleSet> sampleSets, int groupType, boolean hasMoreSample)

Builder for Group.

Parameters

Expand

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.

Public Methods

getActivity()

Expand

Method

public String getActivity()

Obtains the activity.

Returns

Expand

Type

Description

String

Activity type as a string.

getActivityRecord()

Expand

Method

public ActivityRecord getActivityRecord()

Obtains the activity record if data is grouped by activity record. Otherwise, null is returned.

Returns

Expand

Type

Description

ActivityRecord

Activity record.

getActivityType()

Expand

Method

public final int getActivityType()

Obtains the activity type.

Returns

Expand

Type

Description

int

Activity type.

getEndTime(TimeUnit timeUnit)

Expand

Method

public long getEndTime(TimeUnit timeUnit)

Returns the end time.

Parameters

Expand

Name

Description

timeUnit

Time unit.

Returns

Expand

Type

Description

long

End time.

getGroupType()

Expand

Method

public int getGroupType()

Returns the group type.

Returns

Expand

Type

Description

int

Group type.

getGroupTypeString(int groupType)

Expand

Method

public static String getGroupTypeString(int groupType)

Obtains the name of the group type.

Parameters

Expand

Name

Description

groupType

Group type.

Returns

Expand

Type

Description

String

Name of the group type.

getSampleSet(DataType dataType)

Expand

Method

public SampleSet getSampleSet(DataType dataType)

Returns the sampling dataset based on data type within the grouping time duration.

Parameters

Expand

Name

Description

dataType

Data type.

Returns

Expand

Type

Description

SampleSet

Sampling dataset.

getSampleSets()

Expand

Method

public List<SampleSet> getSampleSets()

Returns the sampling datasets within the grouping time duration.

Returns

Expand

Type

Description

List<SampleSet>

Sampling dataset.

getStartTime(TimeUnit timeUnit)

Expand

Method

public long getStartTime(TimeUnit timeUnit)

Returns the start time.

Parameters

Expand

Name

Description

timeUnit

Time unit.

Returns

Expand

Type

Description

long

Start time.

hasMoreSample()

Expand

Method

public final boolean hasMoreSample()

Checks whether the server has more data to transfer.

Returns

Expand

Type

Description

boolean

Whether the server has more data to transfer.

hasSameSample(Group group)

Expand

Method

public final boolean hasSameSample(Group group)

Checks whether the group has the same structure.

Parameters

Expand

Name

Description

group

Grouped data class.

Returns

Expand

Type

Description

boolean

Whether the group has the same structure.

Search
Enter a keyword.