Creates a new instance of Group given a definition and the parent class.
The definition of the group.
The class which contains this group.
The scale of this group relative to the base group. This is used for conversions of values with the same base group.
The unit of the base group. The base group is typically the smallest value and is also where the baseUnit matches unit.
The scale of this group relative to the first base group added to the class. This is used to compare numbers of the same class across all bases.
Whether this group is considered common. A common group is one a developer has decided the user will be familiar with and would be okay seeing values in this unit.
The list of valid denominators for this group. Values when converted to fractions look at this list to ensure that fractions are not produced that are not user friendly. For example, no one would say 5/23 a meter.
Whether this group was dynamically created by user input having units not mapped to groups by the developer.
The class this group belongs to.
The longest unit in this group that is used for plural values.
The longest unit in this group that is used for plural values.
The unit the developer prefers for their users.
This defines how to calculate the scale of the group by multiplying it by
the group of relativeUnit
.
The unit this group is relative to.
The longest unit in this group that is used for singular values.
The shortest unit in this group that is used for singular values.
The System this group belongs in. One of System.METRIC, System.US, or System.ANY.
The main unit for this group. This is the preferred unit if one is not specified in the definition.
A map of all valid units and whether they are singular, plural, or either.
True if this group is a base group, otherwise false.
Adds a denominator or array of denominators to this group.
A denominator or an array of denominators to add.
The reference to this instance.
Adds the given unit aliases to this group and the parent class.
The units to add to the group and class.
The reference to this instance.
Invokes a callback for each group in the parent class that are visible based on the given transform relative to this group.
The transform which decides what groups are visible.
If the groups of the class should be iterated in reverse.
A function to invoke with all visible groups found and the
index of that group in the set of visible groups. If false
is returned
by the function iteration of visible groups ceases.
The current visible group.
The index of the current visible group.
Removes the given unit aliases from this group and the parent class.
The array of unit aliases to remove.
The reference to this instance.
Sets the common flag of this group.
Whether this group is common or not.
The reference to this instance.
Sets the denominators of this group.
The new denominators for this group.
The reference to this instance.
Sets the dynamic flag of this group.
Whether this group is dynamic or not.
The reference to this instance.
Sets the preferred unit of this group.
The preferred unit of this group.
The reference to this instance.
Updates the singular and plural long and short form units for this group.
The reference to this instance.
Generated using TypeDoc
A unit and its aliases as well as their plurality.
A group is relative to a base group or is a base group itself. As unit aliases are added to the group it determines the appropriate plural and singular long and short versions given the unit aliases in this group.