Interface LanguageType
- All Superinterfaces:
net.okapia.osid.torrefacto.collect.TypeEnum
- All Known Implementing Classes:
EnglishRegionTypes, ISOAncientLanguageTypes, ISOConstructedLanguageTypes, ISOExtinctLanguageTypes, ISOMajorLanguageTypes, USEnglishDialectTypes
ISOMajorLanguageTypes (ISO 639-2), the ISO 639-3 ISOAncientLanguageTypes, ISOExtinctLanguageTypes, and ISOConstructedLanguageTypes, and the regional subtypes such as EnglishRegionTypes (which
qualify a language with a region, e.g. ENG/US). It lets a
single argument accept a language drawn from any of those enumerations
while excluding script and format types.
It also answers a language's ISO codes, so a caller bridging to a
platform that speaks ISO 639 — java.util.Locale, CLDR, a BCP-47
tag — need not read them out of a Type's identifier. Each is optional:
ISO 639-1 names only a few hundred languages, and a regional subtype is
named by no ISO 639 code at all, answering instead the codes of the
language it qualifies.
The three-letter codes come in two sets. ISO 639-2 gives twenty
languages a distinct bibliographic code, used in library cataloguing,
alongside the terminological one; for every other language the two are
the same. The terminological set is what ISO 639-3,
java.util.Locale, and BCP-47 use, and it is what these enumerations name
their constants for, so getISO3 is the code to reach for unless
bibliographic data is what you are handling.
-
Method Summary
Modifier and TypeMethodDescriptiongetISO2()Gets the ISO 639-1 two-letter code for this language.Gets the ISO 639-1 two-letter code for a language Type.getISO3()Gets the ISO 639 terminological three-letter code for this language.Gets the ISO 639 terminological three-letter code for a language Type.Gets the ISO 639-2 bibliographic three-letter code for this language, which differs from the terminological code for twenty languages and is the same code for every other.getISOBibliographicCode(Type type) Gets the ISO 639-2 bibliographic three-letter code for a language Type.Methods inherited from interface net.okapia.osid.torrefacto.collect.TypeEnum
getType
-
Method Details
-
getISO2
-
getISO3
-
getISOBibliographicCode
-
getISO2
Gets the ISO 639-1 two-letter code for a language Type.- Parameters:
type- a language type- Returns:
- the two-letter code, empty if the Type names no language these enumerations know, or one with no such code
- Throws:
NullArgumentException-typeisnull
-
getISO3
Gets the ISO 639 terminological three-letter code for a language Type.- Parameters:
type- a language type- Returns:
- the three-letter code, empty if the Type names no language these enumerations know, or one with no such code
- Throws:
NullArgumentException-typeisnull
-
getISOBibliographicCode
Gets the ISO 639-2 bibliographic three-letter code for a language Type.- Parameters:
type- a language type- Returns:
- the bibliographic code, empty if the Type names no language these enumerations know, or one with no such code
- Throws:
NullArgumentException-typeisnull
-