Package com.ilib

Class IlibLocale


  • public class IlibLocale
    extends java.lang.Object
    IlibLocale
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String language  
      protected java.lang.String region  
      protected java.lang.String script  
      protected java.lang.String variant  
    • 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)  
    • Field Detail

      • language

        protected java.lang.String language
      • region

        protected java.lang.String region
      • script

        protected java.lang.String script
      • variant

        protected java.lang.String variant
    • Constructor Detail

      • IlibLocale

        public IlibLocale​(java.lang.String spec)
        Parameters:
        spec -
      • IlibLocale

        public IlibLocale​(java.lang.String language,
                          java.lang.String region,
                          java.lang.String script,
                          java.lang.String variant)
        Parameters:
        language -
        region -
        script -
        variant -
    • 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 class java.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 class java.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