1 Clazz.load (null, "java.util.Date", null, function () {
3 Clazz.decorateAsType (java.util.Date, "java.util.Date", null, [java.io.Serializable, Cloneable, Comparable]);
5 Clazz.defineMethod (java.util.Date, "clone",
7 return new Date (this.getTime ());
10 Clazz.defineMethod (java.util.Date, "before",
12 return this.getTime () < when.getTime ();
14 Clazz.defineMethod (java.util.Date, "after",
16 return this.getTime () > when.getTime ();
18 Clazz.defineMethod (java.util.Date, "equals",
20 return Clazz.instanceOf (obj, java.util.Date) && this.getTime () == (obj).getTime ();
22 Clazz.defineMethod (java.util.Date, "compareTo",
23 function (anotherDate) {
24 var thisTime = this.getTime ();
25 var anotherTime = anotherDate.getTime ();
26 return (thisTime < anotherTime ? -1 : (thisTime == anotherTime ? 0 : 1));
28 Clazz.defineMethod (java.util.Date, "compareTo",
30 return this.compareTo (o);
32 Clazz.defineMethod (java.util.Date, "hashCode",
34 var ht = this.getTime ();
35 return parseInt (ht) ^ parseInt ((ht >> 32));