Measurement<T extends Measurement<T> > class
abstract
Base class for any type of measurement.
- Implemented types
-
- Comparable<
T>
- Comparable<
- Implementers
Constructors
- Measurement(double si, Precision precision)
-
Constructs a basic measurement.
const
- Measurement.infinite()
-
An infinite measurement.
const
- Measurement.negativeInfinite()
-
A negative infinite measurement.
const
-
Measurement.sum(Iterable<
T> parts, Precision precision) - Constructs a measurement representing the sum of other measurements.
- Measurement.zero()
-
A measurement of zero.
const
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- isFinite → bool
-
Returns
true
if this measurement is finite.no setter - isInfinite → bool
-
Returns
true
if this measurement is infinite (either positive or negative).no setter - isNaN → bool
-
Returns
true
if this measurement cannot be expressed as a number.no setter - isNegative → bool
-
Returns
true
if this measurement is negative.no setter - precision → int
-
Returns the number of digits of precision this measurement has.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- si → double
-
The SI value this measurement is based on.
final
Methods
-
acceptVisitor(
MeasurementVisitor visitor) → void - Accept a visitor object for double-dispatch.
-
compareMagnitude(
T other) → double - Returns the difference in magnitude between this and another measurement.
-
compareTo(
T other) → int -
Compares this object to another object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withPrecision(
Precision precision) → T - Creates an equivalent measurement with the specified precision.
Operators
-
operator *(
double multiplier) → T - Returns a measurement equivalent to a multiple of this.
-
operator +(
T other) → T - Returns a measurement equivalent to the sum of two others.
-
operator -(
T other) → T - Returns a measurement equivalent to the difference between two others.
-
operator /(
double divisor) → T - Returns a measurement equivalent to a fraction of this.
-
operator <(
T other) → bool -
Returns
true
if this is less than the other measurement. -
operator <=(
T other) → bool -
Returns
true
if this is less than or equal to the other measurement. -
operator ==(
dynamic other) → bool -
The equality operator.
override
-
operator >(
T other) → bool -
Returns
true
if this is greater than the other measurement. -
operator >=(
T other) → bool -
Returns
true
if this is greater than or equal to the other measurement. -
operator unary-(
) → T - Returns a measurement representing the opposite of this.
-
operator ~/(
T other) → int - Returns the truncating division result of this and another measurement.