java.text
Class DateFormatSymbols

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.text.DateFormatSymbols
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

public class DateFormatSymbols
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

DateFormatSymbols is 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. DateFormat and SimpleDateFormat both use DateFormatSymbols to encapsulate this information.

Typically you shouldn't use DateFormatSymbols directly. Rather, you are encouraged to create a date-time formatter with the DateFormat class's factory methods: getTimeInstance, getDateInstance, or getDateTimeInstance. These methods automatically create a DateFormatSymbols for the formatter so that you don't have to. After the formatter is created, you may modify its format pattern using the setPattern method. For more information about creating formatters using DateFormat's factory methods, see DateFormat sample code for java.text.DateFormat definition code for java.text.DateFormat .

If you decide to create a date-time formatter with a specific format pattern for a specific locale, you can do so with:

 new SimpleDateFormat(aPattern, new DateFormatSymbols(aLocale)).
 

DateFormatSymbols objects are cloneable. When you obtain a DateFormatSymbols object, feel free to modify the date-time formatting data. For instance, you can replace the localized date-time format pattern characters with the ones that you feel easy to remember. Or you can change the representative cities to your favorite ones.

New DateFormatSymbols subclasses may be added to support SimpleDateFormat for date-time formatting for additional locales.

See Also:
DateFormat sample code for java.text.DateFormat definition code for java.text.DateFormat , SimpleDateFormat sample code for java.text.SimpleDateFormat definition code for java.text.SimpleDateFormat , SimpleTimeZone sample code for java.util.SimpleTimeZone definition code for java.util.SimpleTimeZone , Serialized Form

Constructor Summary
DateFormatSymbols sample code for java.text.DateFormatSymbols.DateFormatSymbols() definition code for java.text.DateFormatSymbols.DateFormatSymbols() ()
          Construct a DateFormatSymbols object by loading format data from resources for the default locale.
DateFormatSymbols sample code for java.text.DateFormatSymbols.DateFormatSymbols(java.util.Locale) definition code for java.text.DateFormatSymbols.DateFormatSymbols(java.util.Locale) (Locale sample code for java.util.Locale definition code for java.util.Locale  locale)
          Construct a DateFormatSymbols object by loading format data from resources for the given locale.
 
Method Summary
 Object sample code for java.lang.Object definition code for java.lang.Object clone sample code for java.text.DateFormatSymbols.clone() definition code for java.text.DateFormatSymbols.clone() ()
          Overrides Cloneable
 boolean equals sample code for java.text.DateFormatSymbols.equals(java.lang.Object) definition code for java.text.DateFormatSymbols.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Override equals
 String sample code for java.lang.String definition code for java.lang.String [] getAmPmStrings sample code for java.text.DateFormatSymbols.getAmPmStrings() definition code for java.text.DateFormatSymbols.getAmPmStrings() ()
          Gets ampm strings.
 String sample code for java.lang.String definition code for java.lang.String [] getEras sample code for java.text.DateFormatSymbols.getEras() definition code for java.text.DateFormatSymbols.getEras() ()
          Gets era strings.
 String sample code for java.lang.String definition code for java.lang.String getLocalPatternChars sample code for java.text.DateFormatSymbols.getLocalPatternChars() definition code for java.text.DateFormatSymbols.getLocalPatternChars() ()
          Gets localized date-time pattern characters.
 String sample code for java.lang.String definition code for java.lang.String [] getMonths sample code for java.text.DateFormatSymbols.getMonths() definition code for java.text.DateFormatSymbols.getMonths() ()
          Gets month strings.
 String sample code for java.lang.String definition code for java.lang.String [] getShortMonths sample code for java.text.DateFormatSymbols.getShortMonths() definition code for java.text.DateFormatSymbols.getShortMonths() ()
          Gets short month strings.
 String sample code for java.lang.String definition code for java.lang.String [] getShortWeekdays sample code for java.text.DateFormatSymbols.getShortWeekdays() definition code for java.text.DateFormatSymbols.getShortWeekdays() ()
          Gets short weekday strings.
 String sample code for java.lang.String definition code for java.lang.String [] getWeekdays sample code for java.text.DateFormatSymbols.getWeekdays() definition code for java.text.DateFormatSymbols.getWeekdays() ()
          Gets weekday strings.
 String sample code for java.lang.String definition code for java.lang.String [][] getZoneStrings sample code for java.text.DateFormatSymbols.getZoneStrings() definition code for java.text.DateFormatSymbols.getZoneStrings() ()
          Gets timezone strings.
 int hashCode sample code for java.text.DateFormatSymbols.hashCode() definition code for java.text.DateFormatSymbols.hashCode() ()
          Override hashCode.
 void setAmPmStrings sample code for java.text.DateFormatSymbols.setAmPmStrings(java.lang.String[]) definition code for java.text.DateFormatSymbols.setAmPmStrings(java.lang.String[]) (String sample code for java.lang.String definition code for java.lang.String [] newAmpms)
          Sets ampm strings.
 void setEras sample code for java.text.DateFormatSymbols.setEras(java.lang.String[]) definition code for java.text.DateFormatSymbols.setEras(java.lang.String[]) (String sample code for java.lang.String definition code for java.lang.String [] newEras)
          Sets era strings.
 void setLocalPatternChars sample code for java.text.DateFormatSymbols.setLocalPatternChars(java.lang.String) definition code for java.text.DateFormatSymbols.setLocalPatternChars(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  newLocalPatternChars)
          Sets localized date-time pattern characters.
 void setMonths sample code for java.text.DateFormatSymbols.setMonths(java.lang.String[]) definition code for java.text.DateFormatSymbols.setMonths(java.lang.String[]) (String sample code for java.lang.String definition code for java.lang.String [] newMonths)
          Sets month strings.
 void setShortMonths sample code for java.text.DateFormatSymbols.setShortMonths(java.lang.String[]) definition code for java.text.DateFormatSymbols.setShortMonths(java.lang.String[]) (String sample code for java.lang.String definition code for java.lang.String [] newShortMonths)
          Sets short month strings.
 void setShortWeekdays sample code for java.text.DateFormatSymbols.setShortWeekdays(java.lang.String[]) definition code for java.text.DateFormatSymbols.setShortWeekdays(java.lang.String[]) (String sample code for java.lang.String definition code for java.lang.String [] newShortWeekdays)
          Sets short weekday strings.
 void setWeekdays sample code for java.text.DateFormatSymbols.setWeekdays(java.lang.String[]) definition code for java.text.DateFormatSymbols.setWeekdays(java.lang.String[]) (String sample code for java.lang.String definition code for java.lang.String [] newWeekdays)
          Sets weekday strings.
 void setZoneStrings sample code for java.text.DateFormatSymbols.setZoneStrings(java.lang.String[][]) definition code for java.text.DateFormatSymbols.setZoneStrings(java.lang.String[][]) (String sample code for java.lang.String definition code for java.lang.String [][] newZoneStrings)
          Sets timezone strings.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

DateFormatSymbols sample code for java.text.DateFormatSymbols() definition code for java.text.DateFormatSymbols()

public DateFormatSymbols()
Construct a DateFormatSymbols object by loading format data from resources for the default locale.

Throws:
MissingResourceException sample code for java.util.MissingResourceException definition code for java.util.MissingResourceException - if the resources for the default locale cannot be found or cannot be loaded.

DateFormatSymbols sample code for java.text.DateFormatSymbols(java.util.Locale) definition code for java.text.DateFormatSymbols(java.util.Locale)

public DateFormatSymbols(Locale sample code for java.util.Locale definition code for java.util.Locale  locale)
Construct a DateFormatSymbols object by loading format data from resources for the given locale.

Throws:
MissingResourceException sample code for java.util.MissingResourceException definition code for java.util.MissingResourceException - if the resources for the specified locale cannot be found or cannot be loaded.
Method Detail

getEras sample code for java.text.DateFormatSymbols.getEras() definition code for java.text.DateFormatSymbols.getEras()

public String sample code for java.lang.String definition code for java.lang.String [] getEras()
Gets era strings. For example: "AD" and "BC".

Returns:
the era strings.

setEras sample code for java.text.DateFormatSymbols.setEras(java.lang.String[]) definition code for java.text.DateFormatSymbols.setEras(java.lang.String[])

public void setEras(String sample code for java.lang.String definition code for java.lang.String [] newEras)
Sets era strings. For example: "AD" and "BC".

Parameters:
newEras - the new era strings.

getMonths sample code for java.text.DateFormatSymbols.getMonths() definition code for java.text.DateFormatSymbols.getMonths()

public String sample code for java.lang.String definition code for java.lang.String [] getMonths()
Gets month strings. For example: "January", "February", etc.

Returns:
the month strings.

setMonths sample code for java.text.DateFormatSymbols.setMonths(java.lang.String[]) definition code for java.text.DateFormatSymbols.setMonths(java.lang.String[])

public void setMonths(String sample code for java.lang.String definition code for java.lang.String [] newMonths)
Sets month strings. For example: "January", "February", etc.

Parameters:
newMonths - the new month strings.

getShortMonths sample code for java.text.DateFormatSymbols.getShortMonths() definition code for java.text.DateFormatSymbols.getShortMonths()

public String sample code for java.lang.String definition code for java.lang.String [] getShortMonths()
Gets short month strings. For example: "Jan", "Feb", etc.

Returns:
the short month strings.

setShortMonths sample code for java.text.DateFormatSymbols.setShortMonths(java.lang.String[]) definition code for java.text.DateFormatSymbols.setShortMonths(java.lang.String[])

public void setShortMonths(String sample code for java.lang.String definition code for java.lang.String [] newShortMonths)
Sets short month strings. For example: "Jan", "Feb", etc.

Parameters:
newShortMonths - the new short month strings.

getWeekdays sample code for java.text.DateFormatSymbols.getWeekdays() definition code for java.text.DateFormatSymbols.getWeekdays()

public String sample code for java.lang.String definition code for java.lang.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.

setWeekdays sample code for java.text.DateFormatSymbols.setWeekdays(java.lang.String[]) definition code for java.text.DateFormatSymbols.setWeekdays(java.lang.String[])

public void setWeekdays(String sample code for java.lang.String definition code for java.lang.String [] newWeekdays)
Sets weekday strings. For example: "Sunday", "Monday", etc.

Parameters:
newWeekdays - the new weekday strings. The array should be indexed by Calendar.SUNDAY, Calendar.MONDAY, etc.

getShortWeekdays sample code for java.text.DateFormatSymbols.getShortWeekdays() definition code for java.text.DateFormatSymbols.getShortWeekdays()

public String sample code for java.lang.String definition code for java.lang.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.

setShortWeekdays sample code for java.text.DateFormatSymbols.setShortWeekdays(java.lang.String[]) definition code for java.text.DateFormatSymbols.setShortWeekdays(java.lang.String[])

public void setShortWeekdays(String sample code for java.lang.String definition code for java.lang.String [] newShortWeekdays)
Sets short weekday strings. For example: "Sun", "Mon", etc.

Parameters:
newShortWeekdays - the new short weekday strings. The array should be indexed by Calendar.SUNDAY, Calendar.MONDAY, etc.

getAmPmStrings sample code for java.text.DateFormatSymbols.getAmPmStrings() definition code for java.text.DateFormatSymbols.getAmPmStrings()

public String sample code for java.lang.String definition code for java.lang.String [] getAmPmStrings()
Gets ampm strings. For example: "AM" and "PM".

Returns:
the ampm strings.

setAmPmStrings sample code for java.text.DateFormatSymbols.setAmPmStrings(java.lang.String[]) definition code for java.text.DateFormatSymbols.setAmPmStrings(java.lang.String[])

public void setAmPmStrings(String sample code for java.lang.String definition code for java.lang.String [] newAmpms)
Sets ampm strings. For example: "AM" and "PM".

Parameters:
newAmpms - the new ampm strings.

getZoneStrings sample code for java.text.DateFormatSymbols.getZoneStrings() definition code for java.text.DateFormatSymbols.getZoneStrings()

public String sample code for java.lang.String definition code for java.lang.String [][] getZoneStrings()
Gets timezone strings.

Returns:
the timezone strings.

setZoneStrings sample code for java.text.DateFormatSymbols.setZoneStrings(java.lang.String[][]) definition code for java.text.DateFormatSymbols.setZoneStrings(java.lang.String[][])

public void setZoneStrings(String sample code for java.lang.String definition code for java.lang.String [][] newZoneStrings)
Sets timezone strings.

Parameters:
newZoneStrings - the new timezone strings.

getLocalPatternChars sample code for java.text.DateFormatSymbols.getLocalPatternChars() definition code for java.text.DateFormatSymbols.getLocalPatternChars()

public String sample code for java.lang.String definition code for java.lang.String  getLocalPatternChars()
Gets localized date-time pattern characters. For example: 'u', 't', etc.

Returns:
the localized date-time pattern characters.

setLocalPatternChars sample code for java.text.DateFormatSymbols.setLocalPatternChars(java.lang.String) definition code for java.text.DateFormatSymbols.setLocalPatternChars(java.lang.String)

public void setLocalPatternChars(String sample code for java.lang.String definition code for java.lang.String  newLocalPatternChars)
Sets localized date-time pattern characters. For example: 'u', 't', etc.

Parameters:
newLocalPatternChars - the new localized date-time pattern characters.

clone sample code for java.text.DateFormatSymbols.clone() definition code for java.text.DateFormatSymbols.clone()

public Object sample code for java.lang.Object definition code for java.lang.Object  clone()
Overrides Cloneable

Overrides:
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a clone of this instance.
See Also:
Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

hashCode sample code for java.text.DateFormatSymbols.hashCode() definition code for java.text.DateFormatSymbols.hashCode()

public int hashCode()
Override hashCode. Generates a hash code for the DateFormatSymbols object.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

equals sample code for java.text.DateFormatSymbols.equals(java.lang.Object) definition code for java.text.DateFormatSymbols.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Override equals

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable