Located in compilation unit of com.
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | byDigits
true if this substitution should have the default "by digits" behavior, false otherwise |
| private final boolean | useSpaces
true if we automatically insert spaces to separate names of digits set to false by '>>>' in fraction rules, used by Thai. |
| Access | Constructor and Description |
|---|---|
| pack-priv | FractionalPartSubstitution(int pos, NFRuleSet ruleSet, String description)
Constructs a FractionalPartSubstitution. |
| Modifier and Type | Method and Description |
|---|---|
| public double | calcUpperBound(double
The current upper-bound setting. The new
upper bound can't be any higher. oldUpperBound)Implements abstract com. |
| public double | Returns: newRuleValue + oldRuleValueThe result of parsing the substitution newRuleValue, double The partial parse result prior to calling
this function oldRuleValue)Implements abstract com. |
| public Number | Returns: If the match was successful, the current partial parse result; otherwise new Long(0). The result is either a Long or a Double.The string to parse text, ParsePosition Ignored on entry, but updated on exit to point
to the first unmatched character parsePosition, double The partial parse result prior to entering this
function baseValue, double Only consider rules with base values lower than
this when filling in the substitution upperBound, boolean If true, try matching the text as numerals if
matching as words doesn't work lenientParse, int nonNumericalExecutedRuleMask)Overrides com. |
| public void | doSubstitution(double
The number being formatted number, StringBuilder The string to insert the result of formatting
the substitution into toInsertInto, int The position of the owning rule's rule text in
toInsertInto position, int recursionCount)
If in "by digits" mode, fills in the substitution one decimal digit
at a time using the rule set containing this substitution.
|
| pack-priv char | Returns: '>'Implements abstract com. |
| public long | Returns: 0The number being formatted number)Implements abstract com. |
| public double | Returns: number - floor(number)The number being formatted. number)Implements abstract com. |
| byDigits | back to summary |
|---|---|
| private final boolean byDigits true if this substitution should have the default "by digits" behavior, false otherwise | |
| useSpaces | back to summary |
|---|---|
| private final boolean useSpaces true if we automatically insert spaces to separate names of digits set to false by '>>>' in fraction rules, used by Thai. | |
| FractionalPartSubstitution | back to summary |
|---|---|
| pack-priv FractionalPartSubstitution(int pos, NFRuleSet ruleSet, String description) Constructs a FractionalPartSubstitution. This object keeps a flag telling whether it should format by digits or not. In addition, it marks the rule set it calls (if any) as a fraction rule set. | |
| calcUpperBound | back to summary |
|---|---|
| public double calcUpperBound(double oldUpperBound) Implements abstract com. Not used.
| |
| composeRuleValue | back to summary |
|---|---|
| public double composeRuleValue(double newRuleValue, double oldRuleValue) Implements abstract com. Returns the sum of the two partial parse results.
| |
| doParse | back to summary |
|---|---|
| public Number doParse(String text, ParsePosition parsePosition, double baseValue, double upperBound, boolean lenientParse, int nonNumericalExecutedRuleMask) Overrides com. If in "by digits" mode, parses the string as if it were a string of individual digits; otherwise, uses the superclass function.
| |
| doSubstitution | back to summary |
|---|---|
| public void doSubstitution(double number, StringBuilder toInsertInto, int position, int recursionCount) Overrides com. If in "by digits" mode, fills in the substitution one decimal digit at a time using the rule set containing this substitution. Otherwise, uses the superclass function.
| |
| tokenChar | back to summary |
|---|---|
| pack-priv char tokenChar() Implements abstract com. The token character for a FractionalPartSubstitution is >.
| |
| transformNumber | back to summary |
|---|---|
| public long transformNumber(long number) Implements abstract com. Returns the fractional part of the number, which will always be zero if it's a long.
| |
| transformNumber | back to summary |
|---|---|
| public double transformNumber(double number) Implements abstract com. Returns the fractional part of the number.
| |