Class LocaleInfo


  • public class LocaleInfo
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      LocaleInfo()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean areDayOfWeekAbbrAlphabetic​(java.util.Locale locale)
      Are Short Week Days all Alphabetic?
      static boolean areMonthsAlphabetic​(java.util.Locale locale)
      Are months all Alphabetic?
      static java.lang.String getAMPMRegExp​(java.util.Locale locale)
      Retrieve a Regular Expression for AM/PM strings in this Locale
      static java.util.Set<java.lang.String> getAMPMStrings​(java.util.Locale locale)
      Retrieve the Set containing the for this Locale
      static java.util.Map<java.lang.String,​java.lang.Integer> getMonths​(java.util.Locale locale)
      Retrieve the Map of Month name to month index for this Locale
      static java.util.Map<java.lang.String,​java.lang.Integer> getMonthsDefault​(java.util.Locale locale)
      Retrieve the Map of Month name to month index for this Locale
      static java.lang.String getMonthsRegExp​(java.util.Locale locale)
      Retrieve a Regular Expression for months in this Locale
      static java.util.Map<java.lang.String,​java.lang.Integer> getShortMonths​(java.util.Locale locale)
      Retrieve the Map of month abbreviation name to month index for this Locale
      static int getShortMonthsLength​(java.util.Locale locale)
      Retrieve the length of the Short Months
      static java.lang.String getShortMonthsRegExp​(java.util.Locale locale)
      Retrieve a Regular Expression for month abbreviations in this Locale
      static java.util.Set<java.lang.String> getShortWeekdays​(java.util.Locale locale)
      Retrieve the Set containing the week day abbreviations for this Locale
      static java.lang.String getShortWeekdaysRegExp​(java.util.Locale locale)
      Retrieve a Regular Expression for week day abbreviations in this Locale
      static java.util.Set<java.lang.String> getWeekdays​(java.util.Locale locale)
      Retrieve the Set containing the week days for this Locale
      static java.lang.String getWeekdaysRegExp​(java.util.Locale locale)
      Retrieve a Regular Expression for a week day in this Locale
      static java.lang.String isSupported​(java.util.Locale locale)
      Check that this locale is supported.
      static int monthOffset​(java.lang.String month, java.util.Locale locale)  
      static int shortMonthOffset​(java.lang.String month, java.util.Locale locale)  
      static int skipValidAMPM​(java.lang.String input, java.util.Locale locale)
      Check that the input starts with a valid AM/PM string (case insensitive) and if so return the offset of the end of match.
      static int skipValidDayOfWeekAbbr​(java.lang.String input, java.util.Locale locale)
      Check that the input starts with a valid week day abbreviation (case insensitive) and if so return the offset of the end of match.
      static int skipValidMonth​(java.lang.String input, java.util.Locale locale)
      Check that the input starts with a valid month (case insensitive) and if so return the offset of the end of match.
      static int skipValidMonthAbbr​(java.lang.String input, java.util.Locale locale)
      Check that the input starts with a valid month abbreviation (case insensitive) and if so return the offset of the end of match.
      static boolean validDayOfWeekAbbr​(java.lang.String dayOfWeekAbbr, java.util.Locale locale)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LocaleInfo

        public LocaleInfo()
    • Method Detail

      • getMonths

        public static java.util.Map<java.lang.String,​java.lang.Integer> getMonths​(java.util.Locale locale)
        Retrieve the Map of Month name to month index for this Locale
        Parameters:
        locale - Locale we are interested in
        Returns:
        Map of Month name to month index for this Locale
      • getMonthsDefault

        public static java.util.Map<java.lang.String,​java.lang.Integer> getMonthsDefault​(java.util.Locale locale)
        Retrieve the Map of Month name to month index for this Locale
        Parameters:
        locale - Locale we are interested in
        Returns:
        Map of Month name to month index for this Locale
      • getMonthsRegExp

        public static java.lang.String getMonthsRegExp​(java.util.Locale locale)
        Retrieve a Regular Expression for months in this Locale
        Parameters:
        locale - Locale we are interested in
        Returns:
        Regular Expression for months in this locale
      • shortMonthOffset

        public static int shortMonthOffset​(java.lang.String month,
                                           java.util.Locale locale)
      • monthOffset

        public static int monthOffset​(java.lang.String month,
                                      java.util.Locale locale)
      • areMonthsAlphabetic

        public static boolean areMonthsAlphabetic​(java.util.Locale locale)
        Are months all Alphabetic?
        Parameters:
        locale - Locale we are interested in
        Returns:
        True if all month strings are all Alphabetic
      • skipValidMonth

        public static int skipValidMonth​(java.lang.String input,
                                         java.util.Locale locale)
        Check that the input starts with a valid month (case insensitive) and if so return the offset of the end of match.
        Parameters:
        input - The input string
        locale - Locale we are interested in
        Returns:
        Offset of the end of the matched input, or -1 if no match
      • getShortMonths

        public static java.util.Map<java.lang.String,​java.lang.Integer> getShortMonths​(java.util.Locale locale)
        Retrieve the Map of month abbreviation name to month index for this Locale
        Parameters:
        locale - Locale we are interested in
        Returns:
        Map of month abbreviation name to month index for this Locale
      • skipValidMonthAbbr

        public static int skipValidMonthAbbr​(java.lang.String input,
                                             java.util.Locale locale)
        Check that the input starts with a valid month abbreviation (case insensitive) and if so return the offset of the end of match.
        Parameters:
        input - The input string
        locale - Locale we are interested in
        Returns:
        Offset of the end of the matched input, or -1 if no match
      • getShortMonthsRegExp

        public static java.lang.String getShortMonthsRegExp​(java.util.Locale locale)
        Retrieve a Regular Expression for month abbreviations in this Locale
        Parameters:
        locale - Locale we are interested in
        Returns:
        Regular Expression for month abbreviations in this locale
      • getShortMonthsLength

        public static int getShortMonthsLength​(java.util.Locale locale)
        Retrieve the length of the Short Months
        Parameters:
        locale - Locale we are interested in
        Returns:
        The length of the Short Months abbreviation (or -1 if not consistent)
      • getWeekdays

        public static java.util.Set<java.lang.String> getWeekdays​(java.util.Locale locale)
        Retrieve the Set containing the week days for this Locale
        Parameters:
        locale - Locale we are interested in
        Returns:
        Set containing week days for this Locale
      • getWeekdaysRegExp

        public static java.lang.String getWeekdaysRegExp​(java.util.Locale locale)
        Retrieve a Regular Expression for a week day in this Locale
        Parameters:
        locale - Locale we are interested in
        Returns:
        Regular Expression for week day in this locale
      • getShortWeekdays

        public static java.util.Set<java.lang.String> getShortWeekdays​(java.util.Locale locale)
        Retrieve the Set containing the week day abbreviations for this Locale
        Parameters:
        locale - Locale we are interested in
        Returns:
        Set containing week day abbreviations for this Locale
      • areDayOfWeekAbbrAlphabetic

        public static boolean areDayOfWeekAbbrAlphabetic​(java.util.Locale locale)
        Are Short Week Days all Alphabetic?
        Parameters:
        locale - Locale we are interested in
        Returns:
        True if all Short Week Days strings are all Alphabetic
      • getShortWeekdaysRegExp

        public static java.lang.String getShortWeekdaysRegExp​(java.util.Locale locale)
        Retrieve a Regular Expression for week day abbreviations in this Locale
        Parameters:
        locale - Locale we are interested in
        Returns:
        Regular Expression for week day abbreviations in this locale
      • validDayOfWeekAbbr

        public static boolean validDayOfWeekAbbr​(java.lang.String dayOfWeekAbbr,
                                                 java.util.Locale locale)
      • skipValidDayOfWeekAbbr

        public static int skipValidDayOfWeekAbbr​(java.lang.String input,
                                                 java.util.Locale locale)
        Check that the input starts with a valid week day abbreviation (case insensitive) and if so return the offset of the end of match.
        Parameters:
        input - The input string
        locale - Locale we are interested in
        Returns:
        Offset of the end of the matched input, or -1 if no match
      • getAMPMStrings

        public static java.util.Set<java.lang.String> getAMPMStrings​(java.util.Locale locale)
        Retrieve the Set containing the for this Locale
        Parameters:
        locale - Locale we are interested in
        Returns:
        Set containing AM/PM strings for this Locale
      • isSupported

        public static java.lang.String isSupported​(java.util.Locale locale)
        Check that this locale is supported.
        Parameters:
        locale - Locale we are interested in
        Returns:
        String Return reason if not supported, otherwise null.
      • getAMPMRegExp

        public static java.lang.String getAMPMRegExp​(java.util.Locale locale)
        Retrieve a Regular Expression for AM/PM strings in this Locale
        Parameters:
        locale - Locale we are interested in
        Returns:
        Regular Expression for AM/PM strings in this locale
      • skipValidAMPM

        public static int skipValidAMPM​(java.lang.String input,
                                        java.util.Locale locale)
        Check that the input starts with a valid AM/PM string (case insensitive) and if so return the offset of the end of match.
        Parameters:
        input - The input string
        locale - Locale we are interested in
        Returns:
        Offset of the end of the matched input, or -1 if no match