Calendar.java (toString): New method.

* 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.

From-SVN: r31775
This commit is contained in:
Tom Tromey
2000-02-03 18:26:51 +00:00
committed by Tom Tromey
parent 7d3151e1c9
commit 14447d9674
10 changed files with 132 additions and 10 deletions
+16 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1998, 1999 Red Hat, Inc.
/* Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
This file is part of libgcj.
@@ -108,6 +108,21 @@ public abstract class Calendar implements java.io.Serializable, Cloneable
}
}
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 ();
+27 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1998, 1999 Red Hat, Inc.
/* Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
This file is part of libgcj.
@@ -169,6 +169,32 @@ public class SimpleTimeZone extends TimeZone
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)!
+6 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1998, 1999 Red Hat, Inc.
/* Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
This file is part of libgcj.
@@ -152,7 +152,11 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
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.