MeasurementInterpreter<T> class abstract

Interprets a measurement as a specific unit.

MeasurementInterpreters allow Measurements to be interpreted as whatever unit the MeasurementInterpreter was configured for. Users of the library will generally only require the built-in interpreters for the Measurement types being used (e.g. miles or kilo.meters), but if needed, some MeasurementInterpreter subtypes can be configured further (e.g. AreaInterpreter).

MeasurementInterpreters allow the corresponding unit to be instantiated by "calling" it. For instance, one could create a Distance measurement in miles by using the miles interpreter: miles(5). Interpreters are also offered as extensions on num, so they could be used this way: 5.miles.

Users should not need to access the internal workings of MeasurementInterpreters, but instead pass them to the appropriate Measurement instances for interpretation (typically via an as() method, such as Area.asPair).

Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(double value, {Precision precision = Precision.max}) → T
Creates a measurement based on the value and the configured multiplier.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited