Package com.ibm.icu.text
Class SameValueSubstitution
java.lang.Object
com.ibm.icu.text.NFSubstitution
com.ibm.icu.text.SameValueSubstitution
A substitution that passes the value passed to it through unchanged.
Represented by == in rule descriptions.
-
Field Summary
Fields inherited from class com.ibm.icu.text.NFSubstitution
numberFormat, pos, ruleSet
-
Constructor Summary
ConstructorsConstructorDescriptionSameValueSubstitution
(int pos, NFRuleSet ruleSet, String description) Constructs a SameValueSubstution. -
Method Summary
Modifier and TypeMethodDescriptiondouble
calcUpperBound
(double oldUpperBound) SameValueSubstitution doesn't change the upper bound.double
composeRuleValue
(double newRuleValue, double oldRuleValue) Returns newRuleValue and ignores oldRuleValue.(package private) char
The token character for a SameValueSubstitution is =.double
transformNumber
(double number) Returns "number" unchanged.long
transformNumber
(long number) Returns "number" unchanged.Methods inherited from class com.ibm.icu.text.NFSubstitution
doParse, doSubstitution, doSubstitution, equals, getPos, hashCode, isModulusSubstitution, makeSubstitution, setDecimalFormatSymbols, setDivisor, toString
-
Constructor Details
-
SameValueSubstitution
Constructs a SameValueSubstution. This function just uses the superclass constructor, but it performs a check that this substitution doesn't call the rule set that owns it, since that would lead to infinite recursion.
-
-
Method Details
-
transformNumber
public long transformNumber(long number) Returns "number" unchanged.- Specified by:
transformNumber
in classNFSubstitution
- Parameters:
number
- The number being formatted- Returns:
- "number"
-
transformNumber
public double transformNumber(double number) Returns "number" unchanged.- Specified by:
transformNumber
in classNFSubstitution
- Parameters:
number
- The number being formatted- Returns:
- "number"
-
composeRuleValue
public double composeRuleValue(double newRuleValue, double oldRuleValue) Returns newRuleValue and ignores oldRuleValue. (The value we got matching the substitution supersedes the value of the rule that owns the substitution.)- Specified by:
composeRuleValue
in classNFSubstitution
- Parameters:
newRuleValue
- The value resulting from matching the substitutionoldRuleValue
- The value of the rule containing the substitution.- Returns:
- newRuleValue
-
calcUpperBound
public double calcUpperBound(double oldUpperBound) SameValueSubstitution doesn't change the upper bound.- Specified by:
calcUpperBound
in classNFSubstitution
- Parameters:
oldUpperBound
- The current upper bound.- Returns:
- oldUpperBound
-
tokenChar
char tokenChar()The token character for a SameValueSubstitution is =.- Specified by:
tokenChar
in classNFSubstitution
- Returns:
- '='
-