Located in compilation unit of com.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv long | divisor
The divisor of the rule owning this substitution |
| private final NFRule | ruleToUse
If this is a >>> substitution, the rule to use to format the substitution value. |
| Access | Constructor and Description |
|---|---|
| pack-priv | ModulusSubstitution(int
The substitution's position in its rule's rule text pos, NFRule The rule that owns this substitution rule, NFRule The rule that precedes this substitution's
rule in its rule set's rule list rulePredecessor, NFRuleSet ruleSet, String The description for this substitution description)Constructs a ModulusSubstitution. |
| Modifier and Type | Method and Description |
|---|---|
| public double | Returns: The owning rule's divisorIgnored oldUpperBound)Implements abstract com. |
| public double | composeRuleValue(double
The result of parsing the substitution newRuleValue, double The base value of the rule containing the
substitution oldRuleValue)Implements abstract com. |
| public Number | doParse(String
The string to parse text, ParsePosition Ignored on entry, updated on exit to point to
the first unmatched character. parsePosition, double The partial parse result prior to calling this
routine. baseValue, double When searching the rule set for a rule
matching the string passed in, only rules with base values
lower than this are considered upperBound, boolean If true and matching against rules fails,
the substitution will also try matching the text against
numerals using a default-constructed NumberFormat. If false,
no extra work is done. (This value is false whenever the
formatter isn't in lenient-parse mode, but is also false
under some conditions even when the formatter _is_ in
lenient-parse mode.) lenientParse, int nonNumericalExecutedRuleMask)Overrides com. |
| public void | doSubstitution(long
The number being formatted number, StringBuilder The string to insert the result of this substitution
into toInsertInto, int The position of the rule text in toInsertInto position, int recursionCount)
If this is a >>> substitution, use ruleToUse to fill in
the substitution.
|
| public void | doSubstitution(double
The number being formatted number, StringBuilder The string to insert the result of this substitution
into toInsertInto, int The position of the rule text in toInsertInto position, int recursionCount)
If this is a >>> substitution, use ruleToUse to fill in
the substitution.
|
| public boolean | Returns: true if the two substitutions are functionally equivalentThe other substitution that)Overrides com. |
| public boolean | Returns: trueOverrides 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" mod divisorThe number being formatted number)Implements abstract com. |
| public double | Returns: "number" mod divisorThe number being formatted number)Implements abstract com. |
| divisor | back to summary |
|---|---|
| pack-priv long divisor The divisor of the rule owning this substitution | |
| ruleToUse | back to summary |
|---|---|
| private final NFRule ruleToUse If this is a >>> substitution, the rule to use to format the substitution value. Otherwise, null. | |
| ModulusSubstitution | back to summary |
|---|---|
| pack-priv ModulusSubstitution(int pos, NFRule rule, NFRule rulePredecessor, NFRuleSet ruleSet, String description) Constructs a ModulusSubstitution. In addition to the inherited members, a ModulusSubstitution keeps track of the divisor of the rule that owns it, and may also keep a reference to the rule that precedes the rule containing this substitution in the rule set's rule list. | |
| calcUpperBound | back to summary |
|---|---|
| public double calcUpperBound(double oldUpperBound) Implements abstract com. Sets the upper bound down to the owning rule's divisor
| |
| composeRuleValue | back to summary |
|---|---|
| public double composeRuleValue(double newRuleValue, double oldRuleValue) Implements abstract com. Returns the highest multiple of the rule's divisor that its less than or equal to oldRuleValue, plus newRuleValue. (The result is the sum of the result of parsing the substitution plus the base value of the rule containing the substitution, but if the owning rule's base value isn't an even multiple of its divisor, we have to round it down to a multiple of the divisor, or we get unwanted digits in the result.)
| |
| doParse | back to summary |
|---|---|
| public Number doParse(String text, ParsePosition parsePosition, double baseValue, double upperBound, boolean lenientParse, int nonNumericalExecutedRuleMask) Overrides com. If this is a >>> substitution, match only against ruleToUse. Otherwise, use the superclass function.
| |
| doSubstitution | back to summary |
|---|---|
| public void doSubstitution(long number, StringBuilder toInsertInto, int position, int recursionCount) Overrides com. If this is a >>> substitution, use ruleToUse to fill in the substitution. Otherwise, just use the superclass function.
| |
| doSubstitution | back to summary |
|---|---|
| public void doSubstitution(double number, StringBuilder toInsertInto, int position, int recursionCount) Overrides com. If this is a >>> substitution, use ruleToUse to fill in the substitution. Otherwise, just use the superclass function.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object that) Overrides com. Augments the inherited equals() function by comparing divisors and ruleToUse. | |
| isModulusSubstitution | back to summary |
|---|---|
| public boolean isModulusSubstitution() Overrides com. Returns true. This _is_ a ModulusSubstitution.
| |
| setDivisor | back to summary |
|---|---|
| public void setDivisor(int radix, short exponent) Overrides com. Makes the substitution's divisor conform to that of the rule that owns it. Used when the divisor is determined after creation.
| |
| tokenChar | back to summary |
|---|---|
| pack-priv char tokenChar() Implements abstract com. The token character of a ModulusSubstitution is >.
| |
| transformNumber | back to summary |
|---|---|
| public long transformNumber(long number) Implements abstract com. Divides the number being formatted by the rule's divisor and returns the remainder.
| |
| transformNumber | back to summary |
|---|---|
| public double transformNumber(double number) Implements abstract com. Divides the number being formatted by the rule's divisor and returns the remainder.
| |