Located in compilation unit of com.
| Modifier and Type | Field and Description |
|---|---|
| private final double | denominator
The denominator of the fraction we're finding the numerator for. |
| private final boolean | withZeros
True if we format leading zeros (this is a hack for Hebrew spellout) |
| Access | Constructor and Description |
|---|---|
| pack-priv | NumeratorSubstitution(int pos, double denominator, NFRuleSet ruleSet, String description)
Constructs a NumeratorSubstitution. |
| Modifier and Type | Method and Description |
|---|---|
| public double | Returns: The base value of the rule owning this substitutionIgnored oldUpperBound)Implements abstract com. |
| public double | Returns: newRuleValue / oldRuleValueThe result of parsing the substitution newRuleValue, double The owning rule's base value oldRuleValue)Implements abstract com. |
| public Number | doParse(String
The string to parse text, ParsePosition On entry, ignored, but assumed to be 0.
On exit, this is updated to point to the first unmatched
character (or 0 if the substitution didn't match) parsePosition, double A partial parse result that should be
combined with the result of this parse 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(double
The number being formatted. number, StringBuilder The string we insert the result into toInsertInto, int The position in toInsertInto where the owning rule's
rule text begins (this value is added to this substitution's
position to determine exactly where to insert the new text) position, int recursionCount)
Performs a mathematical operation on the number, formats it using
either ruleSet or decimalFormat, and inserts the result into
toInsertInto.
|
| public boolean | Returns: true if the two objects are functionally equivalentThe other NumeratorSubstitution that)Overrides com. |
| pack-priv static String | |
| pack-priv char | Returns: '<'Implements abstract com. |
| public long | Returns: number * denominatorThe number being formatted number)Implements abstract com. |
| public double | Returns: number * denominatorThe number being formatted number)Implements abstract com. |
| denominator | back to summary |
|---|---|
| private final double denominator The denominator of the fraction we're finding the numerator for. (The base value of the rule that owns this substitution.) | |
| withZeros | back to summary |
|---|---|
| private final boolean withZeros True if we format leading zeros (this is a hack for Hebrew spellout) | |
| NumeratorSubstitution | back to summary |
|---|---|
| pack-priv NumeratorSubstitution(int pos, double denominator, NFRuleSet ruleSet, String description) Constructs a NumeratorSubstitution. In addition to the inherited fields, a NumeratorSubstitution keeps track of a denominator, which is merely the base value of the rule that owns it. | |
| calcUpperBound | back to summary |
|---|---|
| public double calcUpperBound(double oldUpperBound) Implements abstract com. Sets the upper bound down to this rule's base value
| |
| composeRuleValue | back to summary |
|---|---|
| public double composeRuleValue(double newRuleValue, double oldRuleValue) Implements abstract com. Divides the result of parsing the substitution by the partial parse result.
| |
| doParse | back to summary |
|---|---|
| public Number doParse(String text, ParsePosition parsePosition, double baseValue, double upperBound, boolean lenientParse, int nonNumericalExecutedRuleMask) Overrides com. Dispatches to the inherited version of this function, but makes sure that lenientParse is off.
| |
| doSubstitution | back to summary |
|---|---|
| public void doSubstitution(double number, StringBuilder toInsertInto, int position, int recursionCount) Overrides com. Performs a mathematical operation on the number, formats it using either ruleSet or decimalFormat, and inserts the result into toInsertInto.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object that) Overrides com. Tests two NumeratorSubstitutions for equality | |
| fixdesc | back to summary |
|---|---|
| pack-priv static String fixdesc(String description) | |
| tokenChar | back to summary |
|---|---|
| pack-priv char tokenChar() Implements abstract com. The token character for a NumeratorSubstitution is <
| |
| transformNumber | back to summary |
|---|---|
| public long transformNumber(long number) Implements abstract com. Returns the number being formatted times the denominator.
| |
| transformNumber | back to summary |
|---|---|
| public double transformNumber(double number) Implements abstract com. Returns the number being formatted times the denominator.
| |