DataPointContainer


class DataPointContainer


Container that provides ease of use methods to access DataPoints in a type safe way.

Example:

dataPointContainer.getData(DataType.LOCATION).forEach { location ->
Log.d(TAG, "location = ${location.latitude}, ${location.longitude}")
}

Summary

Public constructors

DataPointContainer(dataPointList: List<DataPoint<*>>)

Constructs a DataPointContainer using a list of DataPoints.

DataPointContainer(dataPoints: Map<DataType<*, *>, List<DataPoint<*>>>)

Public functions

D?
<T : Number, D : DataPoint<T>> getData(type: AggregateDataType<T, D>)

Returns the DataPoint object with a matching aggregate type, otherwise null if exist in this DataPointContainer.

List<D>
<T : Any, D : DataPoint<T>> getData(type: DeltaDataType<T, D>)

Returns all DataPoint objects with a matching delta type.

Public properties

List<CumulativeDataPoint<*>>

Returns all CumulativeDataPoints contained in this update.

Set<DataType<*, *>>

Set of DataTypes contained within this DataPointContainer.

List<IntervalDataPoint<*>>

Returns all IntervalDataPoints contained in this update.

List<SampleDataPoint<*>>

Returns all SampleDataPoints contained in this update.

List<StatisticalDataPoint<*>>

Returns all StatisticalDataPoints contained in this update.

Public constructors

DataPointContainer

DataPointContainer(dataPointList: List<DataPoint<*>>)

Constructs a DataPointContainer using a list of DataPoints.

DataPointContainer

DataPointContainer(dataPoints: Map<DataType<*, *>, List<DataPoint<*>>>)

Public functions

getData

Added in 1.0.0
fun <T : Number, D : DataPoint<T>> getData(type: AggregateDataType<T, D>): D?

Returns the DataPoint object with a matching aggregate type, otherwise null if exist in this DataPointContainer.

getData

Added in 1.0.0
fun <T : Any, D : DataPoint<T>> getData(type: DeltaDataType<T, D>): List<D>

Returns all DataPoint objects with a matching delta type.

Public properties

cumulativeDataPoints

Added in 1.0.0
val cumulativeDataPointsList<CumulativeDataPoint<*>>

Returns all CumulativeDataPoints contained in this update.

dataTypes

Added in 1.0.0
val dataTypesSet<DataType<*, *>>

Set of DataTypes contained within this DataPointContainer.

intervalDataPoints

Added in 1.0.0
val intervalDataPointsList<IntervalDataPoint<*>>

Returns all IntervalDataPoints contained in this update.

sampleDataPoints

Added in 1.0.0
val sampleDataPointsList<SampleDataPoint<*>>

Returns all SampleDataPoints contained in this update.

statisticalDataPoints

Added in 1.0.0
val statisticalDataPointsList<StatisticalDataPoint<*>>

Returns all StatisticalDataPoints contained in this update.