/** * Convert the specified text and locale into a value. * * @param text the text to convert * @param locale the locale to convert using * @return the value extracted from the text * @throws IllegalArgumentException if the text is invalid */ protected int convertText(String text, Locale locale) { return GJLocaleSymbols.forLocale(locale).dayOfWeekTextToValue(text); }
/** * Obtains the symbols for a locale. * * @param locale the locale, null returns default * @return the symbols, not null */ static GJLocaleSymbols forLocale(Locale locale) { if (locale == null) { locale = Locale.getDefault(); } GJLocaleSymbols symbols = cCache.get(locale); if (symbols == null) { symbols = new GJLocaleSymbols(locale); GJLocaleSymbols oldSymbols = cCache.putIfAbsent(locale, symbols); if (oldSymbols != null) { symbols = oldSymbols; } } return symbols; }
iDaysOfWeek = realignDaysOfWeek(dfs.getWeekdays()); iShortDaysOfWeek = realignDaysOfWeek(dfs.getShortWeekdays()); iMonths = realignMonths(dfs.getMonths()); iShortMonths = realignMonths(dfs.getShortMonths()); iHalfday = dfs.getAmPmStrings(); addSymbols(iParseEras, iEras, integers); if ("en".equals(locale.getLanguage())) { addSymbols(iParseDaysOfWeek, iDaysOfWeek, integers); addSymbols(iParseDaysOfWeek, iShortDaysOfWeek, integers); addNumerals(iParseDaysOfWeek, 1, 7, integers); addSymbols(iParseMonths, iMonths, integers); addSymbols(iParseMonths, iShortMonths, integers); addNumerals(iParseMonths, 1, 12, integers); iMaxEraLength = maxLength(iEras); iMaxDayOfWeekLength = maxLength(iDaysOfWeek); iMaxShortDayOfWeekLength = maxLength(iShortDaysOfWeek); iMaxMonthLength = maxLength(iMonths); iMaxShortMonthLength = maxLength(iShortMonths); iMaxHalfdayLength = maxLength(iHalfday);
/** * Get the maximum length of the abbreviated text returned by this field. * * @param locale the locale to use * @return the maximum abbreviated textual length */ public int getMaximumShortTextLength(Locale locale) { return GJLocaleSymbols.forLocale(locale).getDayOfWeekMaxShortTextLength(); }
/** * Get the abbreviated textual value of the specified time instant. * * @param fieldValue the field value to query * @param locale the locale to use * @return the day of the week, such as 'Mon' */ public String getAsShortText(int fieldValue, Locale locale) { return GJLocaleSymbols.forLocale(locale).dayOfWeekValueToShortText(fieldValue); }
/** * Get the textual value of the specified time instant. * * @param fieldValue the field value to query * @param locale the locale to use * @return the day of the week, such as 'Monday' */ public String getAsText(int fieldValue, Locale locale) { return GJLocaleSymbols.forLocale(locale).dayOfWeekValueToText(fieldValue); }
public String getAsText(int fieldValue, Locale locale) { return GJLocaleSymbols.forLocale(locale).eraValueToText(fieldValue); }
public long set(long instant, String text, Locale locale) { return set(instant, GJLocaleSymbols.forLocale(locale).eraTextToValue(text)); }
/** * Get the maximum length of the text returned by this field. * * @param locale the locale to use * @return the maximum textual length */ public int getMaximumTextLength(Locale locale) { return GJLocaleSymbols.forLocale(locale).getDayOfWeekMaxTextLength(); }
public int getMaximumTextLength(Locale locale) { return GJLocaleSymbols.forLocale(locale).getHalfdayMaxTextLength(); } }
public String getAsShortText(int fieldValue, Locale locale) { return GJLocaleSymbols.forLocale(locale).monthOfYearValueToShortText(fieldValue); }
public String getAsText(int fieldValue, Locale locale) { return GJLocaleSymbols.forLocale(locale).halfdayValueToText(fieldValue); }
public int getMaximumTextLength(Locale locale) { return GJLocaleSymbols.forLocale(locale).getEraMaxTextLength(); }
public int getMaximumShortTextLength(Locale locale) { return GJLocaleSymbols.forLocale(locale).getMonthMaxShortTextLength(); }
protected int convertText(String text, Locale locale) { return GJLocaleSymbols.forLocale(locale).monthOfYearTextToValue(text); }
public int getMaximumTextLength(Locale locale) { return GJLocaleSymbols.forLocale(locale).getMonthMaxTextLength(); }
public String getAsText(int fieldValue, Locale locale) { return GJLocaleSymbols.forLocale(locale).monthOfYearValueToText(fieldValue); }
public long set(long millis, String text, Locale locale) { return set(millis, GJLocaleSymbols.forLocale(locale).halfdayTextToValue(text)); }
/** * Get the maximum length of the abbreviated text returned by this field. * * @param locale the locale to use * @return the maximum abbreviated textual length */ public int getMaximumShortTextLength(Locale locale) { return GJLocaleSymbols.forLocale(locale).getDayOfWeekMaxShortTextLength(); }
/** * Get the abbreviated textual value of the specified time instant. * * @param fieldValue the field value to query * @param locale the locale to use * @return the day of the week, such as 'Mon' */ public String getAsShortText(int fieldValue, Locale locale) { return GJLocaleSymbols.forLocale(locale).dayOfWeekValueToShortText(fieldValue); }