Class: MeasurementSet

MeasurementSet

new epiviz.measurements.MeasurementSet(other)

measurements/measurement-set.js, line 17

A collection of measurements, where each item is stored only once, and iteration is done in the insertion order.

A collection of measurements, where each item is stored only once, and iteration is done in the insertion order.

Name Type Description
other epiviz.measurements.MeasurementSet optional

Classes

Iterator

Methods

add(m){boolean}

measurements/measurement-set.js, line 48
Name Type Description
m epiviz.measurements.Measurement
Returns:
Type Description
boolean true if the measurement was successfully added to the collection and false if there was already a measurement with this id in the collection

addAll(measurements){boolean}

measurements/measurement-set.js, line 123

Returns true if any new measurements were added and false if all measurements were already in the collection.

Returns true if any new measurements were added and false if all measurements were already in the collection.

Name Type Description
measurements epiviz.measurements.MeasurementSet nullable
Returns:
Type Description
boolean

contains(m){boolean}

measurements/measurement-set.js, line 220
Name Type Description
m epiviz.measurements.Measurement
Returns:
Type Description
boolean

first(){epiviz.measurements.Measurement}

measurements/measurement-set.js, line 243
Returns:
Type Description
epiviz.measurements.Measurement

foreach(func, predicate)

measurements/measurement-set.js, line 172

Iterates through all items stored in this collection, in the order they were added.

Iterates through all items stored in this collection, in the order they were added.

Name Type Description
func function

A function called for each measurement matching the given filters. Iteration is stopped if the function returns something that evaluates to true.

predicate function optional

get(index){epiviz.measurements.Measurement}

measurements/measurement-set.js, line 253

Gets measurement at the given index.

Gets measurement at the given index. This method performs in O(n) time, so it's not appropriate for iteration.

Name Type Description
index
Returns:
Type Description
epiviz.measurements.Measurement

iterator(){epiviz.utils.Iterator.<epiviz.measurements.Measurement>}

measurements/measurement-set.js, line 183
Returns:
Type Description
epiviz.utils.Iterator.<epiviz.measurements.Measurement>

map(transformer){epiviz.measurements.MeasurementSet}

measurements/measurement-set.js, line 203
Name Type Description
transformer function
Returns:
Type Description
epiviz.measurements.MeasurementSet

raw(){Array.<{id: string, name: string, type: epiviz.measurements.Measurement.Type, datasourceId: string, datasourceGroup: string, dataprovider: string, formula: null, defaultChartType: ?string, annotation: ?Object.<string, string>, minValue: ?number, maxValue: ?number, metadata: ?Array.<string>}>}

measurements/measurement-set.js, line 298
Returns:
Type Description
Array.<{id: string, name: string, type: epiviz.measurements.Measurement.Type, datasourceId: string, datasourceGroup: string, dataprovider: string, formula: null, defaultChartType: ?string, annotation: ?Object.<string, string>, minValue: ?number, maxValue: ?number, metadata: ?Array.<string>}>

remove(m){boolean}

measurements/measurement-set.js, line 89
Name Type Description
m epiviz.measurements.Measurement
Returns:
Type Description
boolean true if the measurement was in the collection and false if there was no measurement with this id in the collection

removeAll(measurements){boolean}

measurements/measurement-set.js, line 146
Name Type Description
measurements epiviz.measurements.MeasurementSet
Returns:
Type Description
boolean

size(){number}

measurements/measurement-set.js, line 214
Returns:
Type Description
number

sorted(comparer){epiviz.measurements.MeasurementSet}

measurements/measurement-set.js, line 287
Name Type Description
comparer function
Returns:
Type Description
epiviz.measurements.MeasurementSet

split(criterion){Object.<string, epiviz.measurements.MeasurementSet>}

measurements/measurement-set.js, line 311
Name Type Description
criterion function
Returns:
Type Description
Object.<string, epiviz.measurements.MeasurementSet>

subset(predicate){epiviz.measurements.MeasurementSet}

measurements/measurement-set.js, line 192
Name Type Description
predicate function optional
Returns:
Type Description
epiviz.measurements.MeasurementSet

toArray(){Array.<epiviz.measurements.Measurement>}

measurements/measurement-set.js, line 274
Returns:
Type Description
Array.<epiviz.measurements.Measurement>
comments powered by Disqus