目录

SamplePoint

CLASS info

public class SamplePoint implements Parcelable

采样点类,是特定数据采集器在某时刻(或一段时间)采集到的特定数据类型的样本。保存了该时刻(或时间范围内)数据类型各维度的值,以及采样的起止时间。

采样点的采样方式根据数据类型的定义,分为瞬时采样和区间采样两种,

在设置采样点时间时,建议瞬时数据使用 setSamplingTime() 接口,区间数据使用setTimeInterval()接口(必须是一个有效时间段)。

另外,

瞬时数据也可以使用 setTimeInterval() 接口设置时间,但传入的开始时间和结束时间必须相同,否则无法创建成功;

区间数据在初次创建时不支持使用 setSamplingTime(),否则无法创建成功;但该接口可以用来更新已创建的区间采样点的结束时间,调用后仅会更新结束时间。

Nested Class Summary

Type

Name

Desc

Class

public static class Builder

采样点构造器

Public Method Summary

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)

Inherited Method Summary

[h2]equals(Object obj)/hashCode()/toString()

From class

Return type

Method name

java.lang.Object

boolean

public boolean equals(Object obj)

int

public int hashCode()

String

public String toString()

[h2]describeContents()/writeToParcel(Parcel dest, int flags)

From class

Return type

Method name

android.os.Parcelable

int

describeContents()

void

writeToParcel(Parcel dest, int flags)

Public Methods

[h2]getDataType()

Method

public DataType getDataType()

获取此采样点的数据类型

Return

Type

Return desc

DataType

数据类型

[h2]getDataCollector()

Method

public DataCollector getDataCollector()

获取此采样点的数据采集器

Return

Type

Return desc

DataCollector

数据采集器

[h2]getRawDataCollector()

Method

public DataCollector getRawDataCollector()

获取此采样点的原始数据采集器

Return

Type

Return desc

DataCollector

数据采集器

[h2]getNullableRawCollector()

Method

public DataCollector getNullableRawCollector()

获取此采样点的原始数据采集器,未设置返回Null

Return

Type

Return desc

DataCollector

数据采集器

[h2]getFieldValue(Field field)

Method

public Value getFieldValue(Field field)

获取该属性值

Parameters

Parameter name

Parameter desc

field

数据属性

Return

Type

Return desc

Value

Value对象

[h2]getStartTime(TimeUnit timeUnit)

Method

public long getStartTime(TimeUnit timeUnit)

获取此采样点的开始时间戳

Parameters

Parameter name

Parameter desc

timeUnit

时间单位

Return

Type

Return desc

long

开始时间

[h2]getSamplingTime(TimeUnit timeUnit)

Method

public long getSamplingTime(TimeUnit timeUnit)

获取采样点的时间戳

Parameters

Parameter name

Parameter desc

timeUnit

时间单位

Return

Type

Return desc

long

时间戳

[h2]getEndTime(TimeUnit timeUnit)

Method

public long getEndTime(TimeUnit timeUnit)

获取此采样点的结束时间戳

Parameters

Parameter name

Parameter desc

timeUnit

时间单位

Return

Type

Return desc

long

结束时间

[h2]setSamplingTime(long sampleTime, TimeUnit timeUnit)

Method

public final SamplePoint setSamplingTime(long sampleTime, TimeUnit timeUnit)

设置瞬间数据的采样时间戳

Parameters

Parameter name

Parameter desc

sampleTime

时间戳

timeUnit

时间单位

Return

Type

Return desc

SamplePoint

采样点

[h2]setTimeInterval(long start, long end, TimeUnit timeUnit)

Method

public final SamplePoint setTimeInterval(long start, long end, TimeUnit timeUnit)

设置区间数据的采样时间戳

Parameters

Parameter name

Parameter desc

start

开始时间

end

结束时间

timeUnit

时间单位

Return

Type

Return desc

SamplePoint

采样点

[h2]getId()

Method

public long getId()

获取此采样点的id

Return

Type

Return desc

long

id

[h2]setId()

Method

public long setId()

设置此采样点的id

Return

Type

Return desc

long

id

[h2]create(DataCollector dataCollector)

Method

public SamplePoint create(DataCollector dataCollector)

构造采样点

Parameters

Parameter name

Parameter desc

dataCollector

数据采集器

Return

Type

Return desc

SamplePoint

采样点

[h2]equals(Object object)

Method

public boolean equals(Object object)

[h2]hashCode()

Method

public int hashCode()

[h2]toString()

Method

public String toString()

[h2]describeContents()

Method

public final int describeContents()

[h2]writeToParcel(Parcel dest, int flags)

Method

public void writeToParcel(Parcel dest, int flags)