Package com.ilib
Class IlibLocale
- java.lang.Object
-
- com.ilib.IlibLocale
-
public class IlibLocale extends java.lang.ObjectIlibLocale
-
-
Constructor Summary
Constructors Constructor Description IlibLocale(java.lang.String spec)IlibLocale(java.lang.String language, java.lang.String region, java.lang.String script, java.lang.String variant)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)booleanequals(java.lang.String spec)java.util.LocalegetJavaLocale()Return the equivalent Java locale for this ilib locale.java.lang.StringgetLanguage()java.lang.StringgetRegion()java.lang.StringgetScript()java.lang.StringgetSpec()java.lang.StringgetVariant()booleanisCompatibleWith(IlibLocale other)Return whether or not the current locale is compatible with the given locale.protected booleanisLanguageCode(java.lang.String str)booleanisPseudo()protected booleanisRegionCode(java.lang.String str)protected booleanisScriptCode(java.lang.String str)java.lang.StringtoString()
-
-
-
Method Detail
-
isLanguageCode
protected boolean isLanguageCode(java.lang.String str)
-
isRegionCode
protected boolean isRegionCode(java.lang.String str)
-
isScriptCode
protected boolean isScriptCode(java.lang.String str)
-
getSpec
public java.lang.String getSpec()
- Returns:
- the locale specifier
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getLanguage
public java.lang.String getLanguage()
-
getRegion
public java.lang.String getRegion()
-
getScript
public java.lang.String getScript()
-
getVariant
public java.lang.String getVariant()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
equals
public boolean equals(java.lang.String spec)
- Parameters:
spec-- Returns:
- whether this locale represents the same locale as the given spec
-
isCompatibleWith
public boolean isCompatibleWith(IlibLocale other)
Return whether or not the current locale is compatible with the given locale. A locale is compatible with another locale if the other locale is one of its ancestors. That is, if the current locale inherits from the given locale eventually, then they are compatible.- Parameters:
other- the locale to check against- Returns:
- true if the the current locale is compatible with the other locale
-
isPseudo
public boolean isPseudo()
- Returns:
- true if this is the pseudolocalization locale
-
getJavaLocale
public java.util.Locale getJavaLocale()
Return the equivalent Java locale for this ilib locale.- Returns:
- the equivalent Java locale
-
-