| Modifier and Type | Field and Description |
|---|---|
| pack-priv String | |
| private StringBuilder | buffer
Temporary buffer for parsed sections of data. |
| private boolean | |
| private static final char | |
| private static final char | DONE
Character to indicate no more text is available in the id. |
| private static final char | |
| private boolean | |
| private static final char | |
| private char[] | id
Char array representing the locale ID. |
| private int | |
| private static final char | |
| private static final char | |
| private static final char | KEYWORD_SEPARATOR
Parsing constants. |
| pack-priv Map | |
| private static final char |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| private void | |
| private boolean | |
| public void | defaultKeywordValue(String keywordName, String value)
Set the keyword value only if it is not already set to something else. |
| public String | getBaseName()
Returns the normalized base form of the locale id. The base form does not include keywords. |
| public String | |
| private Comparator | |
| private String | |
| public Map | |
| public Iterator | |
| public String | getKeywordValue(String keywordName)
Returns the value for the named keyword, or null if the keyword is not present. |
| public String | |
| public String[] | getLanguageScriptCountryVariant()
Returns the language, script, country, and variant as separate strings. |
| public String | getName()
Returns the normalized full form of the locale id. The full form includes keywords if they are present. |
| public String | |
| private String | |
| private String | |
| public String | |
| private boolean | haveExperimentalLanguagePrefix()
Returns true if the start of the buffer has an experimental or private language prefix, the pattern '[ixIX][-_].' shows the syntax checked. |
| private boolean | |
| private static boolean | |
| private static boolean | |
| private boolean | isTerminator(char c)
Returns true if the character is a terminator (keyword separator, dot, or DONE). |
| private boolean | |
| private char | |
| public void | |
| private int | |
| private int | |
| private int | |
| private int | |
| private int | |
| private void | |
| private void | |
| public void | |
| public void | setKeywordValue(String keywordName, String value)
Set the value for the named keyword, or unset it if value is null. |
| private void | setKeywordValue(String keywordName, String value, boolean reset)
Set the value for the named keyword, or unset it if value is null. |
| private boolean | setToKeywordStart()
If we have keywords, advance index to the start of the keywords and return true, otherwise return false. |
| private void | |
| private void | |
| private void | |
| private void | skipUntilTerminatorOrIDSeparator()
Advance index until the next terminator or id separator, and leave it there. |
| baseName | back to summary |
|---|---|
| pack-priv String baseName | |
| buffer | back to summary |
|---|---|
| private StringBuilder buffer Temporary buffer for parsed sections of data. | |
| canonicalize | back to summary |
|---|---|
| private boolean canonicalize | |
| COMMA | back to summary |
|---|---|
| private static final char COMMA | |
| DONE | back to summary |
|---|---|
| private static final char DONE Character to indicate no more text is available in the id. | |
| DOT | back to summary |
|---|---|
| private static final char DOT | |
| hadCountry | back to summary |
|---|---|
| private boolean hadCountry | |
| HYPHEN | back to summary |
|---|---|
| private static final char HYPHEN | |
| id | back to summary |
|---|---|
| private char[] id Char array representing the locale ID. | |
| index | back to summary |
|---|---|
| private int index Current position in | |
| ITEM_SEPARATOR | back to summary |
|---|---|
| private static final char ITEM_SEPARATOR | |
| KEYWORD_ASSIGN | back to summary |
|---|---|
| private static final char KEYWORD_ASSIGN | |
| KEYWORD_SEPARATOR | back to summary |
|---|---|
| private static final char KEYWORD_SEPARATOR Parsing constants. | |
| keywords | back to summary |
|---|---|
| pack-priv Map<String, String> keywords | |
| UNDERSCORE | back to summary |
|---|---|
| private static final char UNDERSCORE | |
| LocaleIDParser | back to summary |
|---|---|
| public LocaleIDParser(String localeID) | |
| LocaleIDParser | back to summary |
|---|---|
| public LocaleIDParser(String localeID, boolean canonicalize) | |
| addSeparator | back to summary |
|---|---|
| private void addSeparator() | |
| append | back to summary |
|---|---|
| private void append(char c) Append c to the buffer. | |
| append | back to summary |
|---|---|
| private void append(String s) Append the string to the buffer. | |
| atTerminator | back to summary |
|---|---|
| private boolean atTerminator() Returns true if the character at index in the id is a terminator. | |
| defaultKeywordValue | back to summary |
|---|---|
| public void defaultKeywordValue(String keywordName, String value) Set the keyword value only if it is not already set to something else. | |
| getBaseName | back to summary |
|---|---|
| public String getBaseName() Returns the normalized base form of the locale id. The base form does not include keywords. | |
| getCountry | back to summary |
|---|---|
| public String getCountry() return the normalized country id, or the empty string. | |
| getKeyComparator | back to summary |
|---|---|
| private Comparator | |
| getKeyword | back to summary |
|---|---|
| private String getKeyword() | |
| getKeywordMap | back to summary |
|---|---|
| public Map Returns a map of the keywords and values, or null if there are none. | |
| getKeywords | back to summary |
|---|---|
| public Iterator Returns an iterator over the keywords, or null if we have an empty map. | |
| getKeywordValue | back to summary |
|---|---|
| public String getKeywordValue(String keywordName) Returns the value for the named keyword, or null if the keyword is not present. | |
| getLanguage | back to summary |
|---|---|
| public String getLanguage() Returns the normalized language id, or the empty string. | |
| getLanguageScriptCountryVariant | back to summary |
|---|---|
| public String[] getLanguageScriptCountryVariant() Returns the language, script, country, and variant as separate strings. | |
| getName | back to summary |
|---|---|
| public String getName() Returns the normalized full form of the locale id. The full form includes keywords if they are present. | |
| getScript | back to summary |
|---|---|
| public String getScript() Returns the normalized script id, or the empty string. | |
| getString | back to summary |
|---|---|
| private String getString(int start) Returns the text in the buffer from start to blen as a String. | |
| getValue | back to summary |
|---|---|
| private String getValue() | |
| getVariant | back to summary |
|---|---|
| public String getVariant() Returns the normalized variant id, or the empty string. | |
| haveExperimentalLanguagePrefix | back to summary |
|---|---|
| private boolean haveExperimentalLanguagePrefix() Returns true if the start of the buffer has an experimental or private language prefix, the pattern '[ixIX][-_].' shows the syntax checked. | |
| haveKeywordAssign | back to summary |
|---|---|
| private boolean haveKeywordAssign() Returns true if a value separator occurs at or after index. | |
| isDoneOrItemSeparator | back to summary |
|---|---|
| private static boolean isDoneOrItemSeparator(char c) | |
| isDoneOrKeywordAssign | back to summary |
|---|---|
| private static boolean isDoneOrKeywordAssign(char c) | |
| isTerminator | back to summary |
|---|---|
| private boolean isTerminator(char c) Returns true if the character is a terminator (keyword separator, dot, or DONE). Dot is a terminator because of the POSIX form, where dot precedes the codepage. | |
| isTerminatorOrIDSeparator | back to summary |
|---|---|
| private boolean isTerminatorOrIDSeparator(char c) Returns true if the character is a terminator or id separator. | |
| next | back to summary |
|---|---|
| private char next() Returns the character at index in the id, and advance index. The returned character is DONE if index was at the limit of the buffer. The index is advanced regardless so that decrementing the index will always 'unget' the last character returned. | |
| parseBaseName | back to summary |
|---|---|
| public void parseBaseName() | |
| parseCountry | back to summary |
|---|---|
| private int parseCountry() Advance index past country, and accumulate normalized country in buffer. Index must be immediately after the script (if there is one, else language) and IDSeparator. Return the start of the country code in the buffer. | |
| parseKeywords | back to summary |
|---|---|
| private int parseKeywords() Parse the keywords and return start of the string in the buffer. | |
| parseLanguage | back to summary |
|---|---|
| private int parseLanguage() Advance index past language, and accumulate normalized language code in buffer. Index must be at 0 when this is called. Index is left at a terminator or id separator. Returns the start of the language code in the buffer. | |
| parseScript | back to summary |
|---|---|
| private int parseScript() Advance index past script, and accumulate normalized script in buffer. Index must be immediately after the language. If the item at this position is not a script (is not four characters long) leave index and buffer unchanged. Otherwise index is left at a terminator or id separator. Returns the start of the script code in the buffer (this may be equal to the buffer length, if there is no script). | |
| parseVariant | back to summary |
|---|---|
| private int parseVariant() Advance index past variant, and accumulate normalized variant in buffer. This ignores the codepage information from POSIX ids. Index must be immediately after the country or script. Index is left at the keyword separator or at the end of the text. Return the start of the variant code in the buffer. In standard form, we can have the following forms: ll__VVVV ll_CC_VVVV ll_Ssss_VVVV ll_Ssss_CC_VVVV This also handles POSIX ids, which can have the following forms (pppp is code page id): ll_CC.pppp --> ll_CC ll_CC.pppp@VVVV --> ll_CC_VVVV ll_CC@VVVV --> ll_CC_VVVV We identify this use of '@' in POSIX ids by looking for an '=' following the '@'. If there is one, we consider '@' to start a keyword list, instead of being part of a POSIX id. Note since it was decided that we want an option to not handle POSIX ids, this becomes a bit more complex. | |
| reset | back to summary |
|---|---|
| private void reset() | |
| set | back to summary |
|---|---|
| private void set(int pos, String s) Set the length of the buffer to pos, then append the string. | |
| setBaseName | back to summary |
|---|---|
| public void setBaseName(String baseName) | |
| setKeywordValue | back to summary |
|---|---|
| public void setKeywordValue(String keywordName, String value) Set the value for the named keyword, or unset it if value is null. If keywordName itself is null, unset all keywords. If keywordName is not null, value must not be null. | |
| setKeywordValue | back to summary |
|---|---|
| private void setKeywordValue(String keywordName, String value, boolean reset) Set the value for the named keyword, or unset it if value is null. If keywordName itself is null, unset all keywords. If keywordName is not null, value must not be null. If reset is true, ignore any previous value for the keyword, otherwise do not change the keyword (including removal of one or all keywords). | |
| setToKeywordStart | back to summary |
|---|---|
| private boolean setToKeywordStart() If we have keywords, advance index to the start of the keywords and return true, otherwise return false. | |
| skipCountry | back to summary |
|---|---|
| private void skipCountry() Advance index past country. Index must be immediately after the script (if there is one, else language) and IDSeparator. | |
| skipLanguage | back to summary |
|---|---|
| private void skipLanguage() Advance index past language. Index must be at 0 when this is called. Index is left at a terminator or id separator. | |
| skipScript | back to summary |
|---|---|
| private void skipScript() Advance index past script. Index must be immediately after the language and IDSeparator. If the item at this position is not a script (is not four characters long) leave index. Otherwise index is left at a terminator or id separator. | |
| skipUntilTerminatorOrIDSeparator | back to summary |
|---|---|
| private void skipUntilTerminatorOrIDSeparator() Advance index until the next terminator or id separator, and leave it there. | |