Package com.cobber.fta.dates
Class LocaleInfo
- java.lang.Object
-
- com.cobber.fta.dates.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 Localestatic java.util.Set<java.lang.String>
getAMPMStrings(java.util.Locale locale)
Retrieve the Set containing the for this Localestatic 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 Localestatic 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 Localestatic java.lang.String
getMonthsRegExp(java.util.Locale locale)
Retrieve a Regular Expression for months in this Localestatic 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 Localestatic int
getShortMonthsLength(java.util.Locale locale)
Retrieve the length of the Short Monthsstatic java.lang.String
getShortMonthsRegExp(java.util.Locale locale)
Retrieve a Regular Expression for month abbreviations in this Localestatic java.util.Set<java.lang.String>
getShortWeekdays(java.util.Locale locale)
Retrieve the Set containing the week day abbreviations for this Localestatic java.lang.String
getShortWeekdaysRegExp(java.util.Locale locale)
Retrieve a Regular Expression for week day abbreviations in this Localestatic java.util.Set<java.lang.String>
getWeekdays(java.util.Locale locale)
Retrieve the Set containing the week days for this Localestatic java.lang.String
getWeekdaysRegExp(java.util.Locale locale)
Retrieve a Regular Expression for a week day in this Localestatic 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)
-
-
-
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 stringlocale
- 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 stringlocale
- 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 stringlocale
- 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 stringlocale
- Locale we are interested in- Returns:
- Offset of the end of the matched input, or -1 if no match
-
-