Package com.ilib
Class IlibLocale
- java.lang.Object
-
- com.ilib.IlibLocale
-
public class IlibLocale extends java.lang.Object
IlibLocale
-
-
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 boolean
equals(java.lang.Object obj)
boolean
equals(java.lang.String spec)
java.util.Locale
getJavaLocale()
Return the equivalent Java locale for this ilib locale.java.lang.String
getLanguage()
java.lang.String
getRegion()
java.lang.String
getScript()
java.lang.String
getSpec()
java.lang.String
getVariant()
boolean
isCompatibleWith(IlibLocale other)
Return whether or not the current locale is compatible with the given locale.protected boolean
isLanguageCode(java.lang.String str)
boolean
isPseudo()
protected boolean
isRegionCode(java.lang.String str)
protected boolean
isScriptCode(java.lang.String str)
java.lang.String
toString()
-
-
-
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:
toString
in 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:
equals
in 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
-
-