Located in compilation unit of com.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv long | divisor
The divisor of the rule that owns this substitution. |
| Access | Constructor and Description |
|---|---|
| pack-priv | MultiplierSubstitution(int
The substitution's position in its rule's rule text pos, NFRule The rule that owns this substitution rule, NFRuleSet The ruleSet this substitution uses to format its result ruleSet, String The description describing this substitution description)Constructs a MultiplierSubstitution. |
| Modifier and Type | Method and Description |
|---|---|
| public double | Returns: The rule's divisor.Ignored. oldUpperBound)Implements abstract com. |
| public double | Returns: newRuleValue * divisorThe result of matching the substitution newRuleValue, double The base value of the rule containing the
substitution oldRuleValue)Implements abstract com. |
| public boolean | Returns: true if the two substitutions are functionally equalThe other substitution that)Overrides com. |
| public void | setDivisor(int
The radix of the divisor. radix, short The exponent of the divisor. exponent)Overrides com. |
| pack-priv char | Returns: '<'Implements abstract com. |
| public long | Returns: "number" divided by the rule's divisorThe number being formatted. number)Implements abstract com. |
| public double | Returns: "number" divided by the rule's divisorThe number being formatted number)Implements abstract com. |
| divisor | back to summary |
|---|---|
| pack-priv long divisor The divisor of the rule that owns this substitution. | |
| MultiplierSubstitution | back to summary |
|---|---|
| pack-priv MultiplierSubstitution(int pos, NFRule rule, NFRuleSet ruleSet, String description) Constructs a MultiplierSubstitution. This uses the superclass constructor to initialize most members, but this substitution also maintains its own copy of its rule's divisor. | |
| calcUpperBound | back to summary |
|---|---|
| public double calcUpperBound(double oldUpperBound) Implements abstract com. Sets the upper bound down to the rule's divisor.
| |
| composeRuleValue | back to summary |
|---|---|
| public double composeRuleValue(double newRuleValue, double oldRuleValue) Implements abstract com. Returns newRuleValue times the divisor. Ignores oldRuleValue. (The result of matching a << substitution supersedes the base value of the rule that contains it.)
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object that) Overrides com. Augments the superclass's equals() function by comparing divisors. | |
| setDivisor | back to summary |
|---|---|
| public void setDivisor(int radix, short exponent) Overrides com. Sets the substitution's divisor based on the values passed in.
| |
| tokenChar | back to summary |
|---|---|
| pack-priv char tokenChar() Implements abstract com. The token character for a multiplier substitution is <.
| |
| transformNumber | back to summary |
|---|---|
| public long transformNumber(long number) Implements abstract com. Divides the number by the rule's divisor and returns the quotient.
| |
| transformNumber | back to summary |
|---|---|
| public double transformNumber(double number) Implements abstract com. Divides the number by the rule's divisor and returns the quotient. This is an integral quotient if we're filling in the substitution using another rule set, but it's the full quotient (integral and fractional parts) if we're filling in the substitution using a DecimalFormat. (This allows things such as "1.2 million".)
| |