Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.crosswire.common.util
Class Language.CanonicalUtils

    java.lang.Object
      org.crosswire.common.util.Language.CanonicalUtils

Enclosing class:
  Language

    private static final class Language.CanonicalUtils

extends Object

Converts substrings to the canonical representation for language code, script and country.

Constructor Summary
`private` | `Language.CanonicalUtils()` Utility class.

Method Summary
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Language.CanonicalUtils

    private Language.CanonicalUtils()

  Utility class. Private constructor.

Method Detail

### getLanguage

    public static String getLanguage(String specification,
                                     int start,
                                     int end)

  The iso639 language code's canonical form is lower case.

  Parameters:
    `specification` - the bcp47 specification of the language
    `start` - the start of the code
    `end` - the position of the character following the code
  Returns:
    the canonical representation for the code

### getCountry

    public static String getCountry(String specification,
                                    int start,
                                    int end)

  The iso3166 country code's canonical form is upper case.

  Parameters:
    `specification` - the bcp47 specification of the language
    `start` - the start of the code
    `end` - the position of the character following the code
  Returns:
    the canonical representation for the code

### getScript

    public static String getScript(String specification,
                                   int start,
                                   int end)

  The iso15924 script code's canonical form is title case.

  Parameters:
    `specification` - the bcp47 specification of the language
    `start` - the start of the code
    `end` - the position of the character following the code
  Returns:
    the canonical representation for the code

### isUpperASCII

    private static boolean isUpperASCII(char c)

  Determine whether the character is one of A-Z.

  Parameters:
    `c` - the character to examine
  Returns:
    true if it is in A-Z

### isLowerASCII

    private static boolean isLowerASCII(char c)

  Determine whether the character is one of a-z.

  Parameters:
    `c` - the character to examine
  Returns:
    true if it is in a-z

### toUpperASCII

    private static char toUpperASCII(char c)

  Convert a character, in in a-z to its upper case value, otherwise leave it alone.

  Parameters:
    `c` - the character to convert, if in a-z
  Returns:
    the upper case ASCII representation of the character or the character itself.

### toLowerASCII

    private static char toLowerASCII(char c)

  Convert a character, in in A-Z to its lower case value, otherwise leave it alone.

  Parameters:
    `c` - the character to convert, if in A-Z
  Returns:
    the lower case ASCII representation of the character or the character itself.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ¨ 2003-2015
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD