SamplePoint class
Sampling point class, which presents the sampled data of a specific type collected by a specific data collector at a given time or within a time range. It stores the values of each dimension of the data type at the given time (or within the time range) and the start time and end time of the sampling operation.
The sampling modes of sampling points are classified into instantaneous sampling and continuous sampling based on the definition of data types.
When setting the sampling point time, you are advised to call setSamplingTime() for instantaneous sampling data and setTimeInterval() for continuous sampling data (make sure to set a valid time duration). In addition, you can also call setTimeInterval() to set the time for instantaneous sampling data. Make sure that the passed start time and end time are the same. Otherwise, the creation will fail.
The setSamplingTime() API cannot be used when creating the continuous sampling point. Otherwise, the creation will fail. This API can be used to update the end time of a created continuous sampling point. After the API is called, only the end time will be updated.
Constructors
- SamplePoint({DataCollector? dataCollector, DataType? dataType, int? id, DateTime? startTime, DateTime? endTime, DateTime? samplingTime, FieldValueOptions? fieldValueOptions, TimeUnit timeUnit = TimeUnit.MILLISECONDS, String? metadata})
- You must set dataCollector or dataType.
- SamplePoint.fromMap(Map map)
-
factory
Properties
- dataCollector → DataCollector?
-
final
- dataType → DataType?
-
final
- endTime ↔ DateTime?
-
getter/setter pair
- fieldValueOptions ↔ FieldValueOptions?
-
getter/setter pair
-
fieldValues
→ Map<
String, dynamic> ? -
Obtains the field values that are returned from the native platform.
no setter
- getDataType → DataType?
-
no setter
- getDataTypeId → int?
-
no setter
- getInsertionTime → DateTime?
-
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- id ↔ int?
-
getter/setter pair
- metadata ↔ String?
-
getter/setter pair
-
pairs
↔ Map<
String, dynamic> -
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- samplingTime ↔ DateTime?
-
getter/setter pair
- startTime ↔ DateTime?
-
getter/setter pair
- timeUnit ↔ TimeUnit
-
getter/setter pair
Methods
-
addMetadata(
String key, String value) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setFieldValue(
Field field, dynamic value) → void -
setSamplingTime(
DateTime timestamp, TimeUnit timeUnit) → void - Sets the sampling timestamp of instantaneous data.
-
setTimeInterval(
DateTime startTime, DateTime endTime, TimeUnit timeUnit) → void - Sets the sampling timestamp of data within an interval.
-
toMap(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override