This brings java.util.UUID on HEAD more in line with the one merged to the generics branch, by adding in the method compareTo(UUID). It also appeases JAPI a little.
Changelog:
2006-07-16 Andrew John Hughes <[EMAIL PROTECTED]>
* java/util/UUID.java:
(compareTo(Object)): Call compareTo(UUID).
(compareTo(UUID)): Implemented.
--
Andrew :-)
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html
public class gcj extends Freedom implements Java { ... }
Index: java/util/UUID.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/UUID.java,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 UUID.java
--- java/util/UUID.java 16 Jul 2006 04:23:37 -0000 1.1
+++ java/util/UUID.java 16 Jul 2006 22:06:15 -0000
@@ -75,7 +75,9 @@ import java.security.NoSuchAlgorithmExce
* @since 1.5
* @author Sven de Marothy
*/
-public final class UUID extends Object implements Serializable, Comparable
+public final class UUID
+ extends Object
+ implements Serializable, Comparable // genericizeme!
{
private static final long serialVersionUID = -4856846361193249489L;
@@ -127,7 +129,17 @@ public final class UUID extends Object i
*/
public int compareTo(Object val)
{
- UUID o = (UUID)val; // genericizeme!
+ return compareTo((UUID)val);
+ }
+
+ /**
+ * Compare this UUID to another.
+ * The comparison is performed as between two 128-bit integers.
+ *
+ * @return -1 if this < val, 0 if they are equal, 1 if this > val.
+ */
+ public int compareTo(UUID o)
+ {
if( mostSigBits < o.mostSigBits )
return -1;
if( mostSigBits > o.mostSigBits )
@@ -368,4 +380,4 @@ public final class UUID extends Object i
{
return (int)((mostSigBits & 0xF000L) >> 12);
}
-}
\ No newline at end of file
+}
signature.asc
Description: Digital signature
