Top Inners Fields Constructors Methods
com.ibm.icu.number

pack-priv Class NumberSkeletonImpl

extends Object
Class Inheritance
Imports
java.math.BigDecimal, .RoundingMode, java.util.Set, com.ibm.icu.impl.CacheBase, .PatternProps, .SoftCache, .StringSegment, com.ibm.icu.impl.number.MacroProps, .RoundingUtils, com.ibm.icu.number.NumberFormatter.DecimalSeparatorDisplay, .NumberFormatter.GroupingStrategy, .NumberFormatter.RoundingPriority, .NumberFormatter.SignDisplay, .NumberFormatter.TrailingZeroDisplay, .NumberFormatter.UnitWidth, com.ibm.icu.text.DecimalFormatSymbols, .NumberingSystem, com.ibm.icu.util.BytesTrie, .CharsTrie, .CharsTrieBuilder, .Currency, .Currency.CurrencyUsage, .MeasureUnit, .NoUnit, .StringTrieBuilder

Author
sffc

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
NumberSkeletonImpl.BlueprintHelpers

Utility class for methods for processing stems and options that cannot be interpreted literally.

pack-priv static class
NumberSkeletonImpl.EnumToStemString

Utility class for methods that convert from enums to stem strings.

pack-priv static class
NumberSkeletonImpl.GeneratorHelpers

Utility class for methods for generating a token corresponding to each macro-prop.

pack-priv static enum
NumberSkeletonImpl.ParseState

While parsing a skeleton, this enum records what type of option we expect to find next.

pack-priv static enum
NumberSkeletonImpl.StemEnum

All possible stem literals have an entry in the StemEnum.

pack-priv static class
NumberSkeletonImpl.StemToObject

Utility class for methods that convert from StemEnum to corresponding objects or enums.

Field Summary

Modifier and TypeField and Description
pack-priv static final char
ALT_WILDCARD_CHAR

Alternative wildcard char, accept on input but not printed in output

private static final CacheBase<String, UnlocalizedNumberFormatter, Void>
cache

Cache for parsed skeleton strings.

pack-priv static final String
SERIALIZED_STEM_TRIE

A data structure for mapping from stem strings to the stem enum.

pack-priv static final NumberSkeletonImpl.StemEnum[]
STEM_ENUM_VALUES

For mapping from ordinal back to StemEnum in Java.

pack-priv static final char
WILDCARD_CHAR

Default wildcard char, accepted on input and printed in output

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static void
appendMultiple(StringBuilder sb, int cp, int count)

pack-priv static String
private static void
checkNull(Object value, CharSequence content)

public static UnlocalizedNumberFormatter

Returns:

An UnlocalizedNumberFormatter with behavior defined by the given skeleton string.
create
(String
A number skeleton string, possibly not in its shortest form.
skeletonString
)

Creates a NumberFormatter corresponding to the given skeleton string.

public static String

Returns:

A skeleton string in normalized form.
generate
(MacroProps
The NumberFormatter options object.
macros
)

Create a skeleton string corresponding to the given NumberFormatter.

private static void
generateSkeleton(MacroProps macros, StringBuilder sb)

Main skeleton generator function.

public static UnlocalizedNumberFormatter

Returns:

An UnlocalizedNumberFormatter with behavior defined by the given skeleton string.
getOrCreate
(String
A number skeleton string, possibly not in its shortest form.
skeletonString
)

Gets the number formatter for the given number skeleton string from the cache, creating it if it does not exist in the cache.

pack-priv static boolean
isWildcardChar(char c)

Checks whether the char is a wildcard on input

private static NumberSkeletonImpl.ParseState

Returns:

The next state after parsing this option, corresponding to what subset of options to expect next.
parseOption
(NumberSkeletonImpl.ParseState stem, StringSegment segment, MacroProps macros)

Given that the current segment represents an option, parse it and save the result.

private static MacroProps
parseSkeleton(String skeletonString)

Converts from a skeleton string to a MacroProps.

private static NumberSkeletonImpl.ParseState

Returns:

The next state after parsing this stem, corresponding to what subset of options to expect.
parseStem
(StringSegment segment, CharsTrie stemTrie, MacroProps macros)

Given that the current segment represents a stem, parse it and save the result.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait