diff options
Diffstat (limited to 'libjava/java/util')
-rw-r--r-- | libjava/java/util/Calendar.java | 17 | ||||
-rw-r--r-- | libjava/java/util/SimpleTimeZone.java | 28 | ||||
-rw-r--r-- | libjava/java/util/TimeZone.java | 8 |
3 files changed, 49 insertions, 4 deletions
diff --git a/libjava/java/util/Calendar.java b/libjava/java/util/Calendar.java index 406ccd4..34921d0 100644 --- a/libjava/java/util/Calendar.java +++ b/libjava/java/util/Calendar.java @@ -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 (); diff --git a/libjava/java/util/SimpleTimeZone.java b/libjava/java/util/SimpleTimeZone.java index f8c8315..84d43d6 100644 --- a/libjava/java/util/SimpleTimeZone.java +++ b/libjava/java/util/SimpleTimeZone.java @@ -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)! diff --git a/libjava/java/util/TimeZone.java b/libjava/java/util/TimeZone.java index 37e1623..16772ad 100644 --- a/libjava/java/util/TimeZone.java +++ b/libjava/java/util/TimeZone.java @@ -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. |