CLASS info |
|---|
public class SamplePoint implements Parcelable |
采样点类,是特定数据采集器在某时刻(或一段时间)采集到的特定数据类型的样本。保存了该时刻(或时间范围内)数据类型各维度的值,以及采样的起止时间。 采样点的采样方式根据数据类型的定义,分为瞬时采样和区间采样两种, 在设置采样点时间时,建议瞬时数据使用 setSamplingTime() 接口,区间数据使用setTimeInterval()接口(必须是一个有效时间段)。 另外, 瞬时数据也可以使用 setTimeInterval() 接口设置时间,但传入的开始时间和结束时间必须相同,否则无法创建成功; 区间数据在初次创建时不支持使用 setSamplingTime(),否则无法创建成功;但该接口可以用来更新已创建的区间采样点的结束时间,调用后仅会更新结束时间。 |
Type | Name | Desc |
|---|---|---|
Class | public static class Builder | 采样点构造器 |
Return | Method |
|---|---|
Builder | builder(DataCollector dataCollector) 创建构造器 |
SamplePoint | create(DataCollector dataCollector) 构造采样点 |
DataType | getDataType() 获取此采样点的数据类型 |
DataCollector | getDataCollector() 获取采样点的数据采集器 |
DataCollector | getRawDataCollector() 获取此采样点的原始数据采集器 |
DataCollector | getNullableRawCollector() 获取此采样点的原始数据采集器,未设置时返回Null |
Value | getFieldValue(Field field) 获取该属性值 |
long | getStartTime(TimeUnit timeUnit) 获取此采样点的开始时间戳 |
long | getSamplingTime (TimeUnit timeUnit) 获取采样点的时间戳 |
long | getEndTime(TimeUnit timeUnit) 获取此采样点的结束时间戳 |
SamplePoint | setSamplingTime(long sampleTime, TimeUnit timeUnit) 设置瞬间数据的采样点时间戳 |
SamplePoint | setTimeInterval(long start, long end, TimeUnit timeUnit) 设置区间数据的采样时间戳 |
long | getId() 获取此采样点的id |
void | setId(long id) 设置此采样点的id |
boolean | equals(Object object) |
int | hashCode() |
String | toString() |
int | describeContents() |
void | writeToParcel(Parcel dest, int flags) |
From class | Return type | Method name |
|---|---|---|
java.lang.Object | boolean | public boolean equals(Object obj) |
int | public int hashCode() | |
String | public String toString() |
From class | Return type | Method name |
|---|---|---|
android.os.Parcelable | int | describeContents() |
void | writeToParcel(Parcel dest, int flags) |
Method |
|---|
public DataType getDataType() |
获取此采样点的数据类型 |
Return
Type | Return desc |
|---|---|
DataType | 数据类型 |
Method |
|---|
public DataCollector getDataCollector() |
获取此采样点的数据采集器 |
Return
Type | Return desc |
|---|---|
DataCollector | 数据采集器 |
Method |
|---|
public DataCollector getRawDataCollector() |
获取此采样点的原始数据采集器 |
Return
Type | Return desc |
|---|---|
DataCollector | 数据采集器 |
Method |
|---|
public DataCollector getNullableRawCollector() |
获取此采样点的原始数据采集器,未设置返回Null |
Return
Type | Return desc |
|---|---|
DataCollector | 数据采集器 |
Method |
|---|
public Value getFieldValue(Field field) |
获取该属性值 |
Parameters
Parameter name | Parameter desc |
|---|---|
field | 数据属性 |
Return
Type | Return desc |
|---|---|
Value | Value对象 |
Method |
|---|
public long getStartTime(TimeUnit timeUnit) |
获取此采样点的开始时间戳 |
Parameters
Parameter name | Parameter desc |
|---|---|
timeUnit | 时间单位 |
Return
Type | Return desc |
|---|---|
long | 开始时间 |
Method |
|---|
public long getSamplingTime(TimeUnit timeUnit) |
获取采样点的时间戳 |
Parameters
Parameter name | Parameter desc |
|---|---|
timeUnit | 时间单位 |
Return
Type | Return desc |
|---|---|
long | 时间戳 |
Method |
|---|
public long getEndTime(TimeUnit timeUnit) |
获取此采样点的结束时间戳 |
Parameters
Parameter name | Parameter desc |
|---|---|
timeUnit | 时间单位 |
Return
Type | Return desc |
|---|---|
long | 结束时间 |
Method |
|---|
public final SamplePoint setSamplingTime(long sampleTime, TimeUnit timeUnit) |
设置瞬间数据的采样时间戳 |
Parameters
Parameter name | Parameter desc |
|---|---|
sampleTime | 时间戳 |
timeUnit | 时间单位 |
Return
Type | Return desc |
|---|---|
SamplePoint | 采样点 |
Method |
|---|
public final SamplePoint setTimeInterval(long start, long end, TimeUnit timeUnit) |
设置区间数据的采样时间戳 |
Parameters
Parameter name | Parameter desc |
|---|---|
start | 开始时间 |
end | 结束时间 |
timeUnit | 时间单位 |
Return
Type | Return desc |
|---|---|
SamplePoint | 采样点 |
Method |
|---|
public long getId() |
获取此采样点的id |
Return
Type | Return desc |
|---|---|
long | id |
Method |
|---|
public long setId() |
设置此采样点的id |
Return
Type | Return desc |
|---|---|
long | id |
Method |
|---|
public SamplePoint create(DataCollector dataCollector) |
构造采样点 |
Parameters
Parameter name | Parameter desc |
|---|---|
dataCollector | 数据采集器 |
Return
Type | Return desc |
|---|---|
SamplePoint | 采样点 |
Method |
|---|
public boolean equals(Object object) |
Method |
|---|
public int hashCode() |
Method |
|---|
public String toString() |
Method |
|---|
public final int describeContents() |
Method |
|---|
public void writeToParcel(Parcel dest, int flags) |