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.MeasurePrefix
getPrefixFromTrieIndex
(int trieIndex) private static int
private boolean
hasNext()
private SingleUnitImpl
Returns the next "single unit" via result.private MeasureUnitImpl
parse()
static MeasureUnitImpl
parseForIdentifier
(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
-