Modifier | Constructor and Description |
---|---|
private |
Language.CanonicalUtils()
Utility class.
|
Modifier and Type | Method and Description |
---|---|
static String |
getCountry(String specification,
int start,
int end)
The iso3166 country code's canonical form is upper case.
|
static String |
getLanguage(String specification,
int start,
int end)
The iso639 language code's canonical form is lower case.
|
static String |
getScript(String specification,
int start,
int end)
The iso15924 script code's canonical form is title case.
|
private static boolean |
isLowerASCII(char c)
Determine whether the character is one of a-z.
|
private static boolean |
isUpperASCII(char c)
Determine whether the character is one of A-Z.
|
private static char |
toLowerASCII(char c)
Convert a character, in in A-Z to its lower case value, otherwise leave it alone.
|
private static char |
toUpperASCII(char c)
Convert a character, in in a-z to its upper case value, otherwise leave it alone.
|
private Language.CanonicalUtils()
public static String getLanguage(String specification, int start, int end)
specification
- the bcp47 specification of the languagestart
- the start of the codeend
- the position of the character following the codepublic static String getCountry(String specification, int start, int end)
specification
- the bcp47 specification of the languagestart
- the start of the codeend
- the position of the character following the codepublic static String getScript(String specification, int start, int end)
specification
- the bcp47 specification of the languagestart
- the start of the codeend
- the position of the character following the codeprivate static boolean isUpperASCII(char c)
c
- the character to examineprivate static boolean isLowerASCII(char c)
c
- the character to examineprivate static char toUpperASCII(char c)
c
- the character to convert, if in a-zprivate static char toLowerASCII(char c)
c
- the character to convert, if in A-Z