Top Description Fields Constructors Methods
com.ibm.icu.text

pack-priv Class IntegralPartSubstitution

Located in compilation unit of com.ibm.icu.text.NFSubstitution.

extends NFSubstitution
Class Inheritance

A substitution that formats the number's integral part. This is represented by << in a fraction rule.

Field Summary

Inherited from com.ibm.icu.text.NFSubstitution:
numberFormatposruleSet

Constructor Summary

AccessConstructor and Description
pack-priv
IntegralPartSubstitution(int pos, NFRuleSet ruleSet, String description)

Constructs an IntegralPartSubstitution.

Method Summary

Modifier and TypeMethod and Description
public double

Returns:

Double.MAX_VALUE
calcUpperBound
(double
Ignored
oldUpperBound
)

Implements abstract com.ibm.icu.text.NFSubstitution.calcUpperBound.

An IntegralPartSubstitution sets the upper bound back up so all potentially matching rules are considered.
public double

Returns:

oldRuleValue + newRuleValue
composeRuleValue
(double
The result of matching the substitution
newRuleValue
,
double
The partial result of the parse prior to calling this function
oldRuleValue
)

Implements abstract com.ibm.icu.text.NFSubstitution.composeRuleValue.

Returns the sum of the result of parsing the substitution and the owning rule's base value.
pack-priv char

Returns:

'<'
tokenChar
()

Implements abstract com.ibm.icu.text.NFSubstitution.tokenChar.

An IntegralPartSubstitution's token character is <
public long

Returns:

"number" unchanged
transformNumber
(long
The number being formatted
number
)

Implements abstract com.ibm.icu.text.NFSubstitution.transformNumber.

Returns the number's integral part.
public double

Returns:

floor(number)
transformNumber
(double
The integral part of the number being formatted
number
)

Implements abstract com.ibm.icu.text.NFSubstitution.transformNumber.

Returns the number's integral part.
Inherited from com.ibm.icu.text.NFSubstitution:
doParsedoSubstitutiondoSubstitutionequalsgetPoshashCodeisModulusSubstitutionmakeSubstitutionsetDecimalFormatSymbolssetDivisortoString

Constructor Detail

IntegralPartSubstitutionback to summary
pack-priv IntegralPartSubstitution(int pos, NFRuleSet ruleSet, String description)

Constructs an IntegralPartSubstitution. This just calls the superclass constructor.

Method Detail

calcUpperBoundback to summary
public double calcUpperBound(double oldUpperBound)

Implements abstract com.ibm.icu.text.NFSubstitution.calcUpperBound.

An IntegralPartSubstitution sets the upper bound back up so all potentially matching rules are considered.

Parameters
oldUpperBound:double

Ignored

Returns:double

Double.MAX_VALUE

Annotations
@Override
composeRuleValueback to summary
public double composeRuleValue(double newRuleValue, double oldRuleValue)

Implements abstract com.ibm.icu.text.NFSubstitution.composeRuleValue.

Returns the sum of the result of parsing the substitution and the owning rule's base value. (The owning rule, at best, has an integral-part substitution and a fractional-part substitution, so we can safely just add them.)

Parameters
newRuleValue:double

The result of matching the substitution

oldRuleValue:double

The partial result of the parse prior to calling this function

Returns:double

oldRuleValue + newRuleValue

Annotations
@Override
tokenCharback to summary
pack-priv char tokenChar()

Implements abstract com.ibm.icu.text.NFSubstitution.tokenChar.

An IntegralPartSubstitution's token character is <

Returns:char

'<'

Annotations
@Override
transformNumberback to summary
public long transformNumber(long number)

Implements abstract com.ibm.icu.text.NFSubstitution.transformNumber.

Returns the number's integral part. (For a long, that's just the number unchanged.)

Parameters
number:long

The number being formatted

Returns:long

"number" unchanged

Annotations
@Override
transformNumberback to summary
public double transformNumber(double number)

Implements abstract com.ibm.icu.text.NFSubstitution.transformNumber.

Returns the number's integral part.

Parameters
number:double

The integral part of the number being formatted

Returns:double

floor(number)

Annotations
@Override