Methods Summary |
---|
public java.lang.Object | clone()
// BEGIN android-changed
try {
return super.clone();
} catch (CloneNotSupportedException e) {
throw new AssertionError();
}
// END android-changed
|
public boolean | equals(java.lang.Object object)Compares this object with the specified object and indicates if they are
equal.
if (this == object) {
return true;
}
if (!(object instanceof DateFormatSymbols)) {
return false;
}
DateFormatSymbols obj = (DateFormatSymbols) object;
if (!localPatternChars.equals(obj.localPatternChars)) {
return false;
}
if (!Arrays.equals(ampms, obj.ampms)) {
return false;
}
if (!Arrays.equals(eras, obj.eras)) {
return false;
}
if (!Arrays.equals(months, obj.months)) {
return false;
}
if (!Arrays.equals(shortMonths, obj.shortMonths)) {
return false;
}
if (!Arrays.equals(shortWeekdays, obj.shortWeekdays)) {
return false;
}
if (!Arrays.equals(weekdays, obj.weekdays)) {
return false;
}
// BEGIN android-changed
// Quick check that may keep us from having to load the zone strings.
if (zoneStrings == null && obj.zoneStrings == null
&& !locale.equals(obj.locale)) {
return false;
}
// Make sure zone strings are loaded.
internalZoneStrings();
obj.internalZoneStrings();
// END android-changed
if (zoneStrings.length != obj.zoneStrings.length) {
return false;
}
for (String[] element : zoneStrings) {
if (element.length != element.length) {
return false;
}
for (int j = 0; j < element.length; j++) {
if (element[j] != element[j]
&& !(element[j].equals(element[j]))) {
return false;
}
}
}
return true;
|
public java.lang.String[] | getAmPmStrings()Returns the array of strings which represent AM and PM. Use the
{@link java.util.Calendar} constants {@code Calendar.AM} and
{@code Calendar.PM} as indices for the array.
return ampms.clone();
|
public java.lang.String[] | getEras()Returns the array of strings which represent BC and AD. Use the
{@link java.util.Calendar} constants {@code GregorianCalendar.BC} and
{@code GregorianCalendar.AD} as indices for the array.
return eras.clone();
|
public java.lang.String | getLocalPatternChars()Returns the pattern characters used by {@link SimpleDateFormat} to
specify date and time fields.
return localPatternChars;
|
public java.lang.String[] | getMonths()Returns the array of strings containing the full names of the months. Use
the {@link java.util.Calendar} constants {@code Calendar.JANUARY} etc. as
indices for the array.
return months.clone();
|
public java.lang.String[] | getShortMonths()Returns the array of strings containing the abbreviated names of the
months. Use the {@link java.util.Calendar} constants
{@code Calendar.JANUARY} etc. as indices for the array.
return shortMonths.clone();
|
public java.lang.String[] | getShortWeekdays()Returns the array of strings containing the abbreviated names of the days
of the week. Use the {@link java.util.Calendar} constants
{@code Calendar.SUNDAY} etc. as indices for the array.
return shortWeekdays.clone();
|
public java.lang.String[] | getWeekdays()Returns the array of strings containing the full names of the days of the
week. Use the {@link java.util.Calendar} constants
{@code Calendar.SUNDAY} etc. as indices for the array.
return weekdays.clone();
|
public java.lang.String[][] | getZoneStrings()Returns the two-dimensional array of strings containing the names of the
time zones. Each element in the array is an array of five strings, the
first is a TimeZone ID, the second and third are the full and abbreviated
time zone names for standard time, and the fourth and fifth are the full
and abbreviated names for daylight time.
// BEGIN android-added
String[][] zoneStrings = internalZoneStrings();
// END android-added
String[][] clone = new String[zoneStrings.length][];
for (int i = zoneStrings.length; --i >= 0;) {
clone[i] = zoneStrings[i].clone();
}
return clone;
|
public int | hashCode()
int hashCode;
hashCode = localPatternChars.hashCode();
for (String element : ampms) {
hashCode += element.hashCode();
}
for (String element : eras) {
hashCode += element.hashCode();
}
for (String element : months) {
hashCode += element.hashCode();
}
for (String element : shortMonths) {
hashCode += element.hashCode();
}
for (String element : shortWeekdays) {
hashCode += element.hashCode();
}
for (String element : weekdays) {
hashCode += element.hashCode();
}
// BEGIN android-added
String[][] zoneStrings = internalZoneStrings();
// END android-added
for (String[] element : zoneStrings) {
for (int j = 0; j < element.length; j++) {
hashCode += element[j].hashCode();
}
}
return hashCode;
|
synchronized java.lang.String[][] | internalZoneStrings()Gets zone strings, initializing them if necessary. Does not create
a defensive copy, so make sure you do so before exposing the returned
arrays to clients.
if (zoneStrings == null) {
zoneStrings = Resources.getDisplayTimeZones(locale.toString());
}
return zoneStrings;
|
public void | setAmPmStrings(java.lang.String[] data)Sets the array of strings which represent AM and PM. Use the
{@link java.util.Calendar} constants {@code Calendar.AM} and
{@code Calendar.PM} as indices for the array.
ampms = data.clone();
|
public void | setEras(java.lang.String[] data)Sets the array of Strings which represent BC and AD. Use the
{@link java.util.Calendar} constants {@code GregorianCalendar.BC} and
{@code GregorianCalendar.AD} as indices for the array.
eras = data.clone();
|
public void | setLocalPatternChars(java.lang.String data)Sets the pattern characters used by {@link SimpleDateFormat} to specify
date and time fields.
if (data == null) {
throw new NullPointerException();
}
localPatternChars = data;
|
public void | setMonths(java.lang.String[] data)Sets the array of strings containing the full names of the months. Use
the {@link java.util.Calendar} constants {@code Calendar.JANUARY} etc. as
indices for the array.
months = data.clone();
|
public void | setShortMonths(java.lang.String[] data)Sets the array of strings containing the abbreviated names of the months.
Use the {@link java.util.Calendar} constants {@code Calendar.JANUARY}
etc. as indices for the array.
shortMonths = data.clone();
|
public void | setShortWeekdays(java.lang.String[] data)Sets the array of strings containing the abbreviated names of the days of
the week. Use the {@link java.util.Calendar} constants
{@code Calendar.SUNDAY} etc. as indices for the array.
shortWeekdays = data.clone();
|
public void | setWeekdays(java.lang.String[] data)Sets the array of strings containing the full names of the days of the
week. Use the {@link java.util.Calendar} constants
{@code Calendar.SUNDAY} etc. as indices for the array.
weekdays = data.clone();
|
public void | setZoneStrings(java.lang.String[][] data)Sets the two-dimensional array of strings containing the names of the
time zones. Each element in the array is an array of five strings, the
first is a TimeZone ID, and second and third are the full and abbreviated
time zone names for standard time, and the fourth and fifth are the full
and abbreviated names for daylight time.
zoneStrings = data.clone();
|
private void | writeObject(java.io.ObjectOutputStream out)
// Ensure internal zone strings are initialized to ensure backward
// compatibility.
internalZoneStrings();
out.defaultWriteObject();
|