public class Locale
extends java.lang.Object
Constructor and Description |
---|
Locale()
This constructor will set both
language and country to their respective UNKNOWN value. |
Locale(Language l)
This constructor defines the
language and sets the country to UNKNOWN. |
Locale(Language l,
Country c)
This constructor defines both
kanguage and country . |
Locale(java.lang.String l,
java.lang.String c)
This constructor defines both
kanguage and country from their string representation. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
Country |
getCountry() |
Language |
getLanguage() |
int |
hashCode() |
public Locale()
language
and country
to their respective UNKNOWN
value.public Locale(Language l)
language
and sets the country
to UNKNOWN.l
- The language of this localepublic Locale(Language l, Country c)
kanguage
and country
.l
- The language of this localec
- The country of this localepublic Locale(java.lang.String l, java.lang.String c)
kanguage
and country
from their string representation.
Their string representation is the 2-letter ISO code for the country and the language. Thay can be provided
in either uppercase or lowercase form but not in a mixed-case form. If one or both parameters cannot be found
in the known languages/countries, they are set to their respective UNKNOWN value.l
- The language of this localec
- The country of this localepublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public Language getLanguage()
public Country getCountry()