To create a ScientificNotation, use one of the factory methods in Notation.
NumberFormatter
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv NumberFormatter. | |
| pack-priv int | |
| pack-priv boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv | ScientificNotation(int engineeringInterval, boolean requireMinInt, int minExponentDigits, NumberFormatter.
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv ScientificNotation | |
| public ScientificNotation | Returns: A ScientificNotation, for chaining.The strategy for displaying the sign in the exponent. exponentSignDisplaySets whether to show the sign on positive and negative exponents in scientific notation. |
| pack-priv MicroPropsGenerator | |
| public ScientificNotation | Returns: A ScientificNotation, for chaining.The minimum number of digits to show in the exponent. minExponentDigits)Sets the minimum number of digits to show in the exponent of scientific notation, padding with zeros if necessary. |
| engineeringInterval | back to summary |
|---|---|
| pack-priv int engineeringInterval | |
| exponentSignDisplay | back to summary |
|---|---|
| pack-priv NumberFormatter. | |
| minExponentDigits | back to summary |
|---|---|
| pack-priv int minExponentDigits | |
| requireMinInt | back to summary |
|---|---|
| pack-priv boolean requireMinInt | |
| ScientificNotation | back to summary |
|---|---|
| pack-priv ScientificNotation(int engineeringInterval, boolean requireMinInt, int minExponentDigits, NumberFormatter. | |
| createCopy | back to summary |
|---|---|
| pack-priv ScientificNotation createCopy() Package-private clone method | |
| withExponentSignDisplay | back to summary |
|---|---|
| public ScientificNotation withExponentSignDisplay(NumberFormatter. Sets whether to show the sign on positive and negative exponents in scientific notation. The default is AUTO, showing the minus sign but not the plus sign. For example, with exponentSignDisplay=ALWAYS, the number 123 will be printed as "1.23E+2" in en-US instead of the default "1.23E2".
| |
| withLocaleData | back to summary |
|---|---|
| pack-priv MicroPropsGenerator withLocaleData(DecimalFormatSymbols symbols, boolean build, MicroPropsGenerator parent) | |
| withMinExponentDigits | back to summary |
|---|---|
| public ScientificNotation withMinExponentDigits(int minExponentDigits) Sets the minimum number of digits to show in the exponent of scientific notation, padding with zeros if necessary. Useful for fixed-width display. For example, with minExponentDigits=2, the number 123 will be printed as "1.23E02" in en-US instead of the default "1.23E2".
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv final ScientificNotation | |
| pack-priv final MicroPropsGenerator | |
| pack-priv final ScientificNotation. | |
| pack-priv final DecimalFormatSymbols |
| Access | Constructor and Description |
|---|---|
| private | ScientificHandler(ScientificNotation notation, DecimalFormatSymbols symbols, boolean safe, MicroPropsGenerator parent)
|
| Modifier and Type | Method and Description |
|---|---|
| public int | apply(FormattedStringBuilder
The string builder to which to apply this modifier. output, int The left index of the string within the builder. Equal to 0 when only one number is
being formatted. leftIndex, int The right index of the string within the string builder. Equal to length when only one
number is being formatted. rightIndex)Implements com. |
| public boolean | containsField(Format.
Implements com. |
| private int | |
| public int | getCodePointCount()
Implements com. |
| public int | getMultiplier(int
The power of ten of the input number. magnitude)Implements com. |
| public Modifier. | getParameters()
Implements com. |
| public int | getPrefixLength()
Implements com. |
| public boolean | |
| public MicroProps | processQuantity(DecimalQuantity
The quantity for consideration and optional mutation. quantity)Implements com.
Deprecated
as a consequence of
Considers the given DecimalQuantity being deprecated.
DecimalQuantity, optionally mutates it, and returns a
MicroProps.
|
| public boolean | semanticallyEquivalent(Modifier other)
Implements com. |
| exponent | back to summary |
|---|---|
| pack-priv int exponent | |
| notation | back to summary |
|---|---|
| pack-priv final ScientificNotation notation | |
| parent | back to summary |
|---|---|
| pack-priv final MicroPropsGenerator parent | |
| precomputedMods | back to summary |
|---|---|
| pack-priv final ScientificNotation. | |
| symbols | back to summary |
|---|---|
| pack-priv final DecimalFormatSymbols symbols | |
| ScientificHandler | back to summary |
|---|---|
| private ScientificHandler(ScientificNotation notation, DecimalFormatSymbols symbols, boolean safe, MicroPropsGenerator parent) | |
| apply | back to summary |
|---|---|
| public int apply(FormattedStringBuilder output, int leftIndex, int rightIndex) Implements com. Doc from com. Apply this Modifier to the string builder.
| |
| containsField | back to summary |
|---|---|
| public boolean containsField(Format. Implements com. Doc from com. Whether the modifier contains at least one occurrence of the given field.
| |
| doApply | back to summary |
|---|---|
| private int doApply(int exponent, FormattedStringBuilder output, int rightIndex) | |
| getCodePointCount | back to summary |
|---|---|
| public int getCodePointCount() Implements com. Doc from com. Returns the number of code points in the modifier, prefix plus suffix.
| |
| getMultiplier | back to summary |
|---|---|
| public int getMultiplier(int magnitude) Implements com. Doc from com. Maps a magnitude to a multiplier in powers of ten. For example, in compact notation in English, a magnitude of 5 (e.g., 100,000) should return a multiplier of -3, since the number is displayed in thousands.
| |
| getParameters | back to summary |
|---|---|
| public Modifier. Implements com. Doc from com. Gets a set of "parameters" for this Modifier.
| |
| getPrefixLength | back to summary |
|---|---|
| public int getPrefixLength() Implements com. Doc from com. Gets the length of the prefix. This information can be used in combination with
| |
| isStrong | back to summary |
|---|---|
| public boolean isStrong() Implements com. Doc from com. Whether this modifier is strong. If a modifier is strong, it should always be applied immediately and not allowed to bubble up. With regard to padding, strong modifiers are considered to be on the inside of the prefix and suffix.
| |
| processQuantity | back to summary |
|---|---|
| public MicroProps processQuantity(DecimalQuantity quantity) Implements com. Doc from com. Deprecated as a consequence of Considers the given
| |
| semanticallyEquivalent | back to summary |
|---|---|
| public boolean semanticallyEquivalent(Modifier other) Implements com. Doc from com. Returns whether this Modifier is *semantically equivalent* to the other Modifier; in many cases, this is the same as equal, but parameters should be ignored.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final int | |
| pack-priv final ScientificNotation. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | apply(FormattedStringBuilder
The string builder to which to apply this modifier. output, int The left index of the string within the builder. Equal to 0 when only one number is
being formatted. leftIndex, int The right index of the string within the string builder. Equal to length when only one
number is being formatted. rightIndex)Implements com. |
| public boolean | containsField(Format.
Implements com. |
| public int | getCodePointCount()
Implements com. |
| public Modifier. | getParameters()
Implements com. |
| public int | getPrefixLength()
Implements com. |
| public boolean | |
| public boolean | semanticallyEquivalent(Modifier other)
Implements com. |
| exponent | back to summary |
|---|---|
| pack-priv final int exponent | |
| handler | back to summary |
|---|---|
| pack-priv final ScientificNotation. | |
| ScientificModifier | back to summary |
|---|---|
| pack-priv ScientificModifier(int exponent, ScientificNotation. | |
| apply | back to summary |
|---|---|
| public int apply(FormattedStringBuilder output, int leftIndex, int rightIndex) Implements com. Doc from com. Apply this Modifier to the string builder.
| |
| containsField | back to summary |
|---|---|
| public boolean containsField(Format. Implements com. Doc from com. Whether the modifier contains at least one occurrence of the given field.
| |
| getCodePointCount | back to summary |
|---|---|
| public int getCodePointCount() Implements com. Doc from com. Returns the number of code points in the modifier, prefix plus suffix.
| |
| getParameters | back to summary |
|---|---|
| public Modifier. Implements com. Doc from com. Gets a set of "parameters" for this Modifier.
| |
| getPrefixLength | back to summary |
|---|---|
| public int getPrefixLength() Implements com. Doc from com. Gets the length of the prefix. This information can be used in combination with
| |
| isStrong | back to summary |
|---|---|
| public boolean isStrong() Implements com. Doc from com. Whether this modifier is strong. If a modifier is strong, it should always be applied immediately and not allowed to bubble up. With regard to padding, strong modifiers are considered to be on the inside of the prefix and suffix.
| |
| semanticallyEquivalent | back to summary |
|---|---|
| public boolean semanticallyEquivalent(Modifier other) Implements com. Doc from com. Returns whether this Modifier is *semantically equivalent* to the other Modifier; in many cases, this is the same as equal, but parameters should be ignored.
| |