2000-02-03 Tom Tromey <tromey@cygnus.com>
+ * java/util/Calendar.java (toString): New method.
+ * java/util/SimpleTimeZone.java (clone): New method.
+ (toString): New method.
+ * java/util/TimeZone.java (clone): New method.
+ * java/text/SimpleDateFormat.java (clone): New method.
+ * java/text/NumberFormat.java (clone): New method.
+ (equals): New method.
+ * java/text/Format.java (clone): New method.
+ * java/text/DateFormatSymbols.java (DateFormatSymbols): New
+ constructor.
+ (clone): New method.
+ * java/text/DateFormat.java (clone): New method.
+ * java/text/Collator.java (clone): New method.
+
+2000-02-03 Tom Tromey <tromey@cygnus.com>
+
* java/io/PipedOutputStream.java (write(byte[], int, int)): New
method.
// Collator.java - Locale-sensitive string comparison.
-/* Copyright (C) 1999 Red Hat, Inc.
+/* Copyright (C) 1999, 2000 Red Hat, Inc.
This file is part of libgcj.
return compare (source, target) == 0;
}
+ public Object clone ()
+ {
+ return super.clone ();
+ }
+
public static synchronized Locale[] getAvailableLocales ()
{
// FIXME.
-/* Copyright (C) 1998, 1999 Red Hat, Inc.
+/* Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
This file is part of libgcj.
return calendar.equals(d.calendar) && numberFormat.equals(d.numberFormat);
}
+ public Object clone ()
+ {
+ // We know the superclass just call's Object's generic cloner.
+ return super.clone ();
+ }
+
public final StringBuffer format (Object obj,
StringBuffer buf, FieldPosition pos)
{
-/* Copyright (C) 1998, 1999 Red Hat, Inc.
+/* Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
This file is part of libgcj.
this (Locale.getDefault());
}
+ // Copy constructor.
+ private DateFormatSymbols (DateFormatSymbols old)
+ {
+ ampms = old.ampms;
+ eras = old.eras;
+ localPatternChars = old.localPatternChars;
+ months = old.months;
+ shortMonths = old.shortMonths;
+ shortWeekdays = old.shortWeekdays;
+ weekdays = old.weekdays;
+ zoneStrings = old.zoneStrings;
+ }
+
public String[] getAmPmStrings()
{
return ampms;
&& equals(zoneStrings, other.zoneStrings));
}
+ public Object clone ()
+ {
+ return new DateFormatSymbols (this);
+ }
+
public int hashCode ()
{
return (hashCode(ampms)
-/* Copyright (C) 1998, 1999 Red Hat, Inc.
+/* Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
This file is part of libgcj.
}
return result;
}
+
+ public Object clone ()
+ {
+ return super.clone ();
+ }
}
-/* Copyright (C) 1998, 1999 Red Hat, Inc.
+/* Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
This file is part of libgcj.
public abstract StringBuffer format (long number,
StringBuffer sbuf, FieldPosition pos);
+ public Object clone ()
+ {
+ // We know the superclass just uses Object's generic cloner.
+ // Why not just inherit? Because the online docs specify that
+ // this method exists for this class.
+ return super.clone ();
+ }
+
+ public boolean equals (Object obj)
+ {
+ if (! (obj instanceof NumberFormat))
+ return false;
+ NumberFormat nf = (NumberFormat) obj;
+ return (groupingUsed == nf.groupingUsed
+ && maximumFractionDigits == nf.maximumFractionDigits
+ && maximumIntegerDigits == nf.maximumIntegerDigits
+ && minimumFractionDigits == nf.minimumFractionDigits
+ && minimumIntegerDigits == nf.minimumIntegerDigits
+ && parseIntegerOnly == nf.parseIntegerOnly);
+ }
+
public static Locale[] getAvailableLocales ()
{
// FIXME.
-/* Copyright (C) 1998, 1999 Red Hat, Inc.
+/* Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
This file is part of libgcj.
other.defaultCenturyStart));
}
+ public Object clone ()
+ {
+ // We know the superclass just call's Object's generic cloner.
+ return super.clone ();
+ }
+
public int hashCode ()
{
int hash = super.hashCode();
-/* Copyright (C) 1998, 1999 Red Hat, Inc.
+/* Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
This file is part of libgcj.
}
}
+ public String toString ()
+ {
+ // We have much latitude in how we implement this.
+ return ("areFieldsSet " + areFieldsSet
+ + "; fields " + fields
+ + "; firstDayOfWeek " + firstDayOfWeek
+ + "; isSet " + isSet
+ + "; isTimeSet " + isTimeSet
+ + "; lenient " + lenient
+ + "; minimalDaysInFirstWeek " + minimalDaysInFirstWeek
+ + "; nextStamp " + nextStamp
+ + "; time " + time
+ + "; zone " + zone);
+ }
+
public static Calendar getInstance ()
{
return new GregorianCalendar ();
-/* Copyright (C) 1998, 1999 Red Hat, Inc.
+/* Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
This file is part of libgcj.
return getID() == other.getID() && hasSameRules(other);
}
+ public Object clone ()
+ {
+ // We know the superclass just call's Object's generic cloner.
+ return super.clone ();
+ }
+
+ public String toString ()
+ {
+ // The docs don't say much about how we might implement this.
+ // We choose a debugging implementation.
+ return ("dstSavings " + dstSavings
+ + "; rawOffset " + rawOffset
+ + "; startDay " + startDay
+ + "; startDayOfWeek " + startDayOfWeek
+ + "; startMode " + startMode
+ + "; startMonth " + startMonth
+ + "; startTime " + startTime
+ + "; startYear " + startYear
+ + "; endDay " + endDay
+ + "; endDayOfWeek " + endDayOfWeek
+ + "; endMode " + endMode
+ + "; endMonth " + endMonth
+ + "; endTime " + endTime
+ + "; useDaylight " + useDaylight);
+ }
+
public int hashCode ()
{
// FIXME - this does not folow any spec (since none is public)!
-/* Copyright (C) 1998, 1999 Red Hat, Inc.
+/* Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
This file is part of libgcj.
return this == other;
}
- // public Object clone ();
+ public Object clone ()
+ {
+ // Just use Object's generic cloner.
+ return super.clone ();
+ }
// Names of timezones. This array is kept in parallel with
// rawOffsets. This list comes from the JCL 1.1 book.