ConversionNode<T> class
This is the building block of the conversion tree. Thanks to the children
parameter you can set other ConversionNodes that depends on this parent
node. Thanks to the coefficientProduct, coefficientSum, conversionType
and base parameters you can set the relationship between this node and the
parent node.
Constructors
-
ConversionNode({required T name, List<
ConversionNode< children = const [], double coefficientProduct = 1.0, double coefficientSum = 0.0, double? value, String? stringValue, ConversionType conversionType = ConversionType.linearConversion})T> >
Properties
-
children
↔ List<
ConversionNode< T> > -
This is the list of the ConversionNodes that depend on this node. These
are the children of this parent node.
getter/setter pair
- coefficientProduct ↔ double
-
This is the product coefficient of ConversionType.linearConversion and
ConversionType.reciprocalConversion. It is the a coefficient.
getter/setter pair
- coefficientSum ↔ double
-
This is the sum coefficient of ConversionType.linearConversion and
ConversionType.reciprocalConversion. It is the b coefficient.
getter/setter pair
- conversionType ↔ ConversionType
-
This define the conversion type between this node and its parent. The
default is ConversionType.linearConversion. This is useless for the
root node (because it has no parent node).
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- name ↔ T
-
This is the name of the unit. Can be a String or an enum.
getter/setter pair
-
parent
↔ ConversionNode<
T> ? -
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringValue ↔ String?
-
This the value that has the unit of measurement of this node. This is
just for numeral systems conversion. In all the other cases use value.
getter/setter pair
- value ↔ double?
-
This the value that has the unit of measurement of this node. This is
valid for the most cases. But not for numeral systems conversion.
getter/setter pair
Methods
-
convert(
double value) → void - Convert this ConversionNode to all the other units
-
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