Package com.ibm.icu.impl.units
Class MeasureUnitImpl.UnitsParser
java.lang.Object
com.ibm.icu.impl.units.MeasureUnitImpl.UnitsParser
- Enclosing class:
MeasureUnitImpl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static MeasureUnit.MeasurePrefixgetPrefixFromTrieIndex(int trieIndex) private static intprivate booleanhasNext()private SingleUnitImplReturns the next "single unit" via result.private MeasureUnitImplparse()static MeasureUnitImplparseForIdentifier(String identifier) Construct a MeasureUnit from a CLDR Unit Identifier, defined in UTS 35.
-
Field Details
-
savedTrie
-
trie
-
fSource
-
fIndex
private int fIndex -
fAfterPer
private boolean fAfterPer -
fSawAnd
private boolean fSawAnd -
measurePrefixValues
-
-
Constructor Details
-
UnitsParser
-
-
Method Details
-
parseForIdentifier
Construct a MeasureUnit from a CLDR Unit Identifier, defined in UTS 35. Validates and canonicalizes the identifier.- Returns:
- MeasureUnitImpl object or null if the identifier is empty.
- Throws:
IllegalArgumentException- in case of invalid identifier.
-
getPrefixFromTrieIndex
-
getTrieIndexForPrefix
-
parse
-
nextSingleUnit
Returns the next "single unit" via result.If a "-per-" was parsed, the result will have appropriate negative dimensionality.
- Throws:
IllegalArgumentException- if we parse both compound units and "-and-", since mixed compound units are not yet supported - TODO(CLDR-13701).
-
hasNext
private boolean hasNext() -
nextToken
-