[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fwd: Re: [cp-patches] Comparable in java.util.Calendar]
From: |
Kendall Bell |
Subject: |
[Fwd: Re: [cp-patches] Comparable in java.util.Calendar] |
Date: |
Fri, 25 Nov 2005 20:38:04 -0600 |
User-agent: |
Thunderbird 1.5 (X11/20051025) |
-------- Original Message --------
Hi Kendall,
On Tue, 2005-11-22 at 09:55 -0600, Kendall Bell wrote:
> 2005-11-21 Kendall Bell <address@hidden>
>
> * java/util/Calendar.java:
> Implemented Comparable.
> (compareTo) Method added.
Thanks. Could you also email that to the classpath-patches list so
others can review? Also Tom said that there was another implementation
on the generics branch (he is in Brazil and can apparently not sent
email). Could you compare that implementation with your implementation?
Subject: |
Lots of email bounces/unsubscribes |
Date: |
Thu, 24 Nov 2005 16:37:18 +0100 |
Hi,
I am seeing a lot of list traffic bounce and/or people being
unsubscribed because spamcop.net has lists.gnu.org in its RBL. If you
are (indirectly through your ISP) using spamcop you will probably not
receive this email. But I post it anyway for people reading the archives
after they have discovered their mail server has been blocking any
gnu.org emails.
I asked the savannah-hackers and gnu.org sysadmins to investigate but
till it has been resolved it would be good to not use the spamcop RBL.
Cheers,
Mark
--
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html
Join the community at http://planet.classpath.org/
signature.asc
Description: This is a digitally signed message part
--- End Message ---
signature.asc
Description: PGP signature
Index: classpath/java/util/Calendar.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/Calendar.java,v
retrieving revision 1.47
diff -u -r1.47 Calendar.java
--- classpath/java/util/Calendar.java 1 Oct 2005 19:45:23 -0000 1.47
+++ classpath/java/util/Calendar.java 22 Nov 2005 15:40:58 -0000
@@ -103,7 +103,7 @@
* @see TimeZone
* @see java.text.DateFormat
*/
-public abstract class Calendar implements Serializable, Cloneable
+public abstract class Calendar implements Serializable, Cloneable, Comparable
{
/**
* Constant representing the era time field.
@@ -1290,5 +1290,18 @@
isSet = new boolean[FIELD_COUNT];
areFieldsSet = false;
}
+ }
+
+ /**
+ *Compares the time values (in millisecond offsets) represented by two
Calendar objects.
+ * @param c the calendar to that we should compare.
+ * @return 0, if the given calendar is equal, -1 if it is less then, or 1 if
greater then.
+ */
+ public int compareTo(Calendar c)
+ {
+ if (getTimeInMillis() == c.getTimeInMillis())
+ return 0;
+ // Returns just -1 or 1 on inequality;
+ return getTimeInMillis() > c.getTimeInMillis() ? 1 : -1;
}
}
kendall.vcf
Description: Vcard
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fwd: Re: [cp-patches] Comparable in java.util.Calendar],
Kendall Bell <=