Package java.text
Class DateFormatSymbols
- java.lang.Object
-
- java.text.DateFormatSymbols
-
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
ComputeShortFormatSymbols
public class DateFormatSymbols extends Object implements Serializable, Cloneable
DateFormatSymbolsis a public class for encapsulating localizable date-time formatting data, such as the names of the months, the names of the days of the week, and the time zone data.DateFormatandSimpleDateFormatboth useDateFormatSymbolsto encapsulate this information.- See Also:
DateFormat,SimpleDateFormat, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DateFormatSymbols()Construct a DateFormatSymbols.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAmPmString(int i)Gets ampm strings.String[]getAmPmStrings()Gets ampm strings.StringgetEra(int i)Gets era strings.String[]getEras()Gets era strings.static DateFormatSymbolsgetInstance()Gets theDateFormatSymbolsinstance in English.StringgetMonth(int i)Gets month strings.String[]getMonths()Gets month strings.StringgetShortMonth(int i)Gets short month strings.String[]getShortMonths()Gets short month strings.StringgetShortWeekday(int i)Gets short weekday strings.String[]getShortWeekdays()Gets short weekday strings.StringgetWeekday(int i)Gets weekday strings.String[]getWeekdays()Gets weekday strings.voidsetAmPmStrings(String[] newAmpms)Sets ampm strings.voidsetEras(String[] newEras)Sets era strings.voidsetMonths(String[] newMonths)Sets month strings.voidsetShortMonths(String[] newShortMonths)Sets short month strings.voidsetShortWeekdays(String[] newShortWeekdays)Sets short weekday strings.voidsetWeekdays(String[] newWeekdays)Sets weekday strings.
-
-
-
Constructor Detail
-
DateFormatSymbols
public DateFormatSymbols()
Construct a DateFormatSymbols.- See Also:
getInstance()
-
-
Method Detail
-
getInstance
public static final DateFormatSymbols getInstance()
Gets theDateFormatSymbolsinstance in English. .- Returns:
- a
DateFormatSymbolsinstance. - Since:
- 1.6
-
getEras
public String[] getEras()
Gets era strings. For example: "AD" and "BC".- Returns:
- the era strings.
-
getEra
public String getEra(int i)
Gets era strings. For example: "AD" and "BC".- Parameters:
i- the number of the era.- Returns:
- the era strings.
-
setEras
public void setEras(String[] newEras)
Sets era strings. For example: "AD" and "BC".- Parameters:
newEras- the new era strings.
-
getMonths
public String[] getMonths()
Gets month strings. For example: "January", "February", etc.- Returns:
- the month strings.
-
getMonth
public String getMonth(int i)
Gets month strings. For example: "January", "February", etc.- Parameters:
i- the number of the month.- Returns:
- the month strings.
-
setMonths
public void setMonths(String[] newMonths)
Sets month strings. For example: "January", "February", etc.- Parameters:
newMonths- the new month strings.
-
getShortMonths
public String[] getShortMonths()
Gets short month strings. For example: "Jan", "Feb", etc.- Returns:
- the short month strings.
-
getShortMonth
public String getShortMonth(int i)
Gets short month strings. For example: "Jan", "Feb", etc.- Parameters:
i- the number of the month.- Returns:
- the short month strings.
-
setShortMonths
public void setShortMonths(String[] newShortMonths)
Sets short month strings. For example: "Jan", "Feb", etc.- Parameters:
newShortMonths- the new short month strings.
-
getWeekdays
public String[] getWeekdays()
Gets weekday strings. For example: "Sunday", "Monday", etc.- Returns:
- the weekday strings. Use
Calendar.SUNDAY,Calendar.MONDAY, etc. to index the result array.
-
getWeekday
public String getWeekday(int i)
Gets weekday strings. For example: "Sunday", "Monday", etc.- Parameters:
i- the number of the weekday.- Returns:
- the weekday strings. Use
Calendar.SUNDAY,Calendar.MONDAY, etc. to index the result array.
-
setWeekdays
public void setWeekdays(String[] newWeekdays)
Sets weekday strings. For example: "Sunday", "Monday", etc.- Parameters:
newWeekdays- the new weekday strings. The array should be indexed byCalendar.SUNDAY,Calendar.MONDAY, etc.
-
getShortWeekdays
public String[] getShortWeekdays()
Gets short weekday strings. For example: "Sun", "Mon", etc.- Returns:
- the short weekday strings. Use
Calendar.SUNDAY,Calendar.MONDAY, etc. to index the result array.
-
getShortWeekday
public String getShortWeekday(int i)
Gets short weekday strings. For example: "Sun", "Mon", etc.- Parameters:
i- the number of the weekday.- Returns:
- the short weekday strings. Use
Calendar.SUNDAY,Calendar.MONDAY, etc. to index the result array.
-
setShortWeekdays
public void setShortWeekdays(String[] newShortWeekdays)
Sets short weekday strings. For example: "Sun", "Mon", etc.- Parameters:
newShortWeekdays- the new short weekday strings. The array should be indexed byCalendar.SUNDAY,Calendar.MONDAY, etc.
-
getAmPmStrings
public String[] getAmPmStrings()
Gets ampm strings. For example: "AM" and "PM".- Returns:
- the ampm strings.
-
getAmPmString
public String getAmPmString(int i)
Gets ampm strings. For example: "AM" and "PM".- Parameters:
i- the number of the am/pm- Returns:
- the ampm strings.
-
setAmPmStrings
public void setAmPmStrings(String[] newAmpms)
Sets ampm strings. For example: "AM" and "PM".- Parameters:
newAmpms- the new ampm strings.
-
-