Distance class

Represents a single dimension of distance.

Inheritance

Constructors

Distance.infinite()
Infinite distance.
const
Distance.negativeInfinite()
Infinite negative distance.
const
Distance.ofCentimeters(num centimeters, {Precision precision = Precision.max})
Distance.ofDecimeters(num decimeters, {Precision precision = Precision.max})
Distance.ofDekameters(num dekameters, {Precision precision = Precision.max})
Distance.ofFeet(num feet, {Precision precision = Precision.max})
Distance.ofHectometers(num hectometers, {Precision precision = Precision.max})
Distance.ofImperial({num miles = 0, num yards = 0, num feet = 0, num inches = 0, Precision precision = Precision.max})
Distance.ofInches(num inches, {Precision precision = Precision.max})
Distance.ofKilometers(num kilometers, {Precision precision = Precision.max})
Distance.ofMeters(num meters, {Precision precision = Precision.max})
Distance.ofMetric({num picometers = 0, num nanometers = 0, num micrometers = 0, num millimeters = 0, num centimeters = 0, num decimeters = 0, num meters = 0, num dekameters = 0, num hectometers = 0, num kilometers = 0, Precision precision = Precision.max})
Distance.ofMicrometers(num micrometers, {Precision precision = Precision.max})
Distance.ofMiles(num miles, {Precision precision = Precision.max})
Distance.ofMillimeters(num millimeters, {Precision precision = Precision.max})
Distance.ofNanometers(num nanometers, {Precision precision = Precision.max})
Distance.ofNauticalMiles(num nauticalMiles, {Precision precision = Precision.max})
Distance.ofPicometers(num picometers, {Precision precision = Precision.max})
Distance.ofYards(num yards, {Precision precision = Precision.max})
Distance.sum(Iterable<Distance> parts, {Precision precision = Precision.max})
Constructs a Distance representing the sum of any number of other Distances.
Distance.zero()
The distance of size zero.
const

Properties

asCentimeters double
no setter
asDecimeters double
no setter
asDekameters double
no setter
asFeet double
no setter
asHectometers double
no setter
asInches double
no setter
asKilometers double
no setter
asMeters double
no setter
asMicrometers double
no setter
asMiles double
no setter
asMillimeters double
no setter
asNanometers double
no setter
asNauticalMiles double
no setter
asPicometers double
no setter
asYards double
no setter
hashCode int
The hash code for this object.
no setterinherited
isFinite bool
Returns true if this measurement is finite.
no setterinherited
isInfinite bool
Returns true if this measurement is infinite (either positive or negative).
no setterinherited
isNaN bool
Returns true if this measurement cannot be expressed as a number.
no setterinherited
isNegative bool
Returns true if this measurement is negative.
no setterinherited
precision int
Returns the number of digits of precision this measurement has.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
si double
The SI value this measurement is based on.
finalinherited

Methods

acceptVisitor(MeasurementVisitor visitor) → void
Accept a visitor object for double-dispatch.
override
as(DistanceInterpreter interpreter) double
Interprets this using the specified units.
compareMagnitude(Distance other) double
Returns the difference in magnitude between this and another measurement.
inherited
compareTo(Distance other) int
Compares this object to another object.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
withPrecision(Precision precision) Distance
Creates an equivalent measurement with the specified precision.
inherited

Operators

operator *(double multiplier) Distance
Returns a measurement equivalent to a multiple of this.
inherited
operator +(Distance other) Distance
Returns a measurement equivalent to the sum of two others.
inherited
operator -(Distance other) Distance
Returns a measurement equivalent to the difference between two others.
inherited
operator /(double divisor) Distance
Returns a measurement equivalent to a fraction of this.
inherited
operator <(Distance other) bool
Returns true if this is less than the other measurement.
inherited
operator <=(Distance other) bool
Returns true if this is less than or equal to the other measurement.
inherited
operator ==(dynamic other) bool
The equality operator.
inherited
operator >(Distance other) bool
Returns true if this is greater than the other measurement.
inherited
operator >=(Distance other) bool
Returns true if this is greater than or equal to the other measurement.
inherited
operator unary-() Distance
Returns a measurement representing the opposite of this.
inherited
operator ~/(Distance other) int
Returns the truncating division result of this and another measurement.
inherited