Class Info |
|---|
public class Group implements Parcelable 聚合数据类,代表一个数据分组,用户可以通过聚合查询获取到一组聚合类数据。 例如,聚合查询某一时间段内体重数据的分组,通过该数据分组反映此段时间内体重数据的最大值、最小值、平均值。 当前,我们支持的分组类型包括:按时间分组,按运动记录分组,按运动类型分组,按单个活动片段分组。 |
Qualifier and Type | Field and Description |
|---|---|
static final int | 表示请求按时间进行分组。 |
static final int | 表示请求按时间间隔进行分组。 |
Constructor Name |
|---|
Group(long startTime, long endTime, ActivityRecord activityRecord, int activityType, List<SampleSet> sampleSets, int groupType, boolean hasMoreSample) Group的构造方法。 |
Qualifier and Type | Method Name and Description |
|---|---|
String | 获取活动。 |
| 如果按照运动记录进行分组,则返回运动记录,否则返回null。 | |
final int | 获取运动类型。 |
long | getEndTime(TimeUnit timeUnit) 获取结束时间。 |
int | 返回分组的类型。 |
static String | getGroupTypeString(int groupType) 获取分组类型的名称。 |
getSampleSet(DataType dataType) 返回分组时间区间内按数据类型请求的采样集。 | |
List<SampleSet> | 返回分组时间区间内的采样集。 |
long | getStartTime(TimeUnit timeUnit) 获取开始时间。 |
final boolean | 判断服务器是否有更多数据。 |
final boolean | hasSameSample(Group group) 判断是否相同结构的分组。 |
Field |
|---|
public static final int TYPE_INTERVALS 类型常量,表示请求按时间间隔进行分组。 Constant Value: 5 |
Constructor |
|---|
public Group(long startTime, long endTime, ActivityRecord activityRecord, int activityType, List<SampleSet> sampleSets, int groupType, boolean hasMoreSample) Group的构造方法。 |
Parameters
Name | Description |
|---|---|
startTime | 开始时间。 |
endTime | 结束时间。 |
activityRecord | 运动记录。 |
activityType | 运动类型。 |
sampleSets | 采样集。 |
groupType | 分组类型。 |
hasMoreSample | 是否有更多的数据。 |
Method |
|---|
public String getActivity() 获取活动。 |
Returns
Type | Description |
|---|---|
String | 活动的字符串类型。 |
Method |
|---|
public ActivityRecord getActivityRecord() 如果按照运动记录进行分组,则返回运动记录,否则返回null。 |
Returns
Type | Description |
|---|---|
运动记录。 |
Method |
|---|
public final int getActivityType() 获取运动类型。 |
Returns
Type | Description |
|---|---|
int | 运动类型。 |
Method |
|---|
public long getEndTime(TimeUnit timeUnit) 返回结束时间。 |
Parameters
Name | Description |
|---|---|
timeUnit | 时间单位。 |
Returns
Type | Description |
|---|---|
long | 结束时间。 |
Method |
|---|
public static String getGroupTypeString(int groupType) 获取分组类型的名称。 |
Parameters
Name | Description |
|---|---|
groupType | 分组类型。 |
Returns
Type | Description |
|---|---|
String | 分组类型的名称。 |
Parameters
Name | Description |
|---|---|
dataType | 数据类型。 |
Returns
Type | Description |
|---|---|
SampleSet | 采样集。 |
Method |
|---|
public List<SampleSet> getSampleSets() 返回分组时间区间内的采样集。 |
Returns
Type | Description |
|---|---|
List<SampleSet> | 采样集。 |
Method |
|---|
public long getStartTime(TimeUnit timeUnit) 返回开始时间。 |
Parameters
Name | Description |
|---|---|
timeUnit | 时间单位。 |
Returns
Type | Description |
|---|---|
long | 开始时间。 |
Method |
|---|
public final boolean hasMoreSample() 判断服务器是否有更多数据。 |
Returns
Type | Description |
|---|---|
boolean | 服务器是否有更多数据。 |
Method |
|---|
public final boolean hasSameSample(Group group) 判断是否相同结构的组。 |
Parameters
Name | Description |
|---|---|
group | 聚合数据类。 |
Returns
Type | Description |
|---|---|
boolean | 是否相同结构的分组。 |