Revision: 3998
          http://vexi.svn.sourceforge.net/vexi/?rev=3998&view=rev
Author:   clrg
Date:     2011-01-25 00:21:11 +0000 (Tue, 25 Jan 2011)

Log Message:
-----------
JSDate
- add constructor
- document properties (jsdoc)
- order properties alphabetically

Modified Paths:
--------------
    trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/JSDate.jpp
    trunk/org.vexi-library.js/src/main/jpp/org/vexi/js/VexiJS.jpp

Modified: trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/JSDate.jpp
===================================================================
--- trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/JSDate.jpp       
2011-01-24 22:43:33 UTC (rev 3997)
+++ trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/JSDate.jpp       
2011-01-25 00:21:11 UTC (rev 3998)
@@ -46,6 +46,15 @@
  */
 public class JSDate extends JS.Immutable {
 
+    static public JS Constructor = new JS.Constructor("Date") {
+        public JS new_(JS[] args) throws JSExn {
+            if (args.length==1) new JSDate((int)JSU.toLong(args[0]));
+            return new JSArray(args);
+        }
+    };
+    public boolean instanceOf(JS constructor){ return 
constructor==Constructor; }
+    public void addConstructor(JS constructor) throws JSExn {throw new 
JSExn("Attemted to add constructor to date"); }
+
     public JSDate() {
         if (thisTimeZone == null) {
             // j.u.TimeZone is synchronized, so setting class statics from it
@@ -123,49 +132,145 @@
 
     public JS get(JS key) throws JSExn {
         //#switch(JSU.toString(key))
-        case "toString": return METHOD;
-        case "toTimeString": return METHOD;
-        case "toDateString": return METHOD;
-        case "toLocaleString": return METHOD;
-        case "toLocaleTimeString": return METHOD;
-        case "toLocaleDateString": return METHOD;
-        case "toUTCString": return METHOD;
-        case "valueOf": return METHOD;
+        /*@PAGE(varname=Date,humanname=Date Object) 
+         * 
+         * <p>The standard js date object.</p>
+         * */
+        /* <p>Returns the day of the month (1-31)</p>
+         * @return(number) */
+        case "getDate": return METHOD;
+        /* <p>Returns the day of the week (0-6)</p>
+         * @return(number) */
+        case "getDay": return METHOD;
+        /* <p>Returns the year</p>
+         * @return(number) */
+        case "getFullYear": return METHOD;
+        /* <p>Returns the hour (0-23)</p>
+         * @return(number) */
+        case "getHours": return METHOD;
+        /* <p>Returns the milliseconds (0-999)</p>
+         * @return(number) */
+        case "getMilliseconds": return METHOD;
+        /* <p>Returns the minutes (0-59)</p>
+         * @return(number) */
+        case "getMinutes": return METHOD;
+        /* <p>Returns the month (0-11)</p>
+         * @return(number) */
+        case "getMonth": return METHOD;
+        /* <p>Returns the seconds (0-59)</p>
+         * @return(number) */
+        case "getSeconds": return METHOD;
+        /* <p>Returns the number of milliseconds since midnight Jan 1, 1970</p>
+         * @return(string) */
         case "getTime": return METHOD;
+        /* <p>Returns the difference, in minutes, between GMT and local 
time</p>
+         * @return(number) */
+        case "getTimezoneOffset": return METHOD;
+        /* <p><b>Deprecated</b> - use getFullYear()</p>
+         * <p>Returns the years since 1900</p>
+         * @return(number) */
         case "getYear": return METHOD;
-        case "getFullYear": return METHOD;
-        case "getUTCFullYear": return METHOD;
-        case "getMonth": return METHOD;
-        case "getUTCMonth": return METHOD;
-        case "getDate": return METHOD;
+        /* <p>Returns the day of the month (1-31) according to universal 
time</p>
+         * @return(number) */
         case "getUTCDate": return METHOD;
-        case "getDay": return METHOD;
+        /* <p>Returns the day of the week (0-6) according to universal time</p>
+         * @return(number) */
         case "getUTCDay": return METHOD;
-        case "getHours": return METHOD;
+        /* <p>Returns the year according to universal time</p>
+         * @return(number) */
+        case "getUTCFullYear": return METHOD;
+        /* <p>Returns the hour (0-23) according to universal time</p>
+         * @return(number) */
         case "getUTCHours": return METHOD;
-        case "getMinutes": return METHOD;
+        /* <p>Returns the milliseconds (0-999) according to universal time</p>
+         * @return(number) */
+        case "getUTCMilliseconds": return METHOD;
+        /* <p>Returns the minutes (0-59) according to universal time</p>
+         * @return(number) */
         case "getUTCMinutes": return METHOD;
-        case "getSeconds": return METHOD;
+        /* <p>Returns the month (0-11) according to universal time</p>
+         * @return(number) */
+        case "getUTCMonth": return METHOD;
+        /* <p>Returns the seconds (0-59) according to universal time</p>
+         * @return(number) */
         case "getUTCSeconds": return METHOD;
-        case "getMilliseconds": return METHOD;
-        case "getUTCMilliseconds": return METHOD;
-        case "getTimezoneOffset": return METHOD;
+        /* <p>Sets the day of the month (1-31)</p>
+         * @return(number) */
+        case "setDate": return METHOD;
+        /* <p>Sets the year</p>
+         * @return(number) */
+        case "setFullYear": return METHOD;
+        /* <p>Sets the hour (0-23)</p>
+         * @return(number) */
+        case "setHours": return METHOD;
+        /* <p>Sets the milliseconds (0-999)</p>
+         * @return(number) */
+        case "setMilliseconds": return METHOD;
+        /* <p>Set the minutes (0-59)</p>
+         * @return(number) */
+        case "setMinutes": return METHOD;
+        /* <p>Sets the month (0-11)</p>
+         * @return(number) */
+        case "setMonth": return METHOD;
+        /* <p>Sets the seconds (0-59)</p>
+         * @return(number) */
+        case "setSeconds": return METHOD;
+        /* <p>Sets a date and time by adding the specified number of 
milliseconds to midnight January 1, 1970</p>
+         * @return(number) */
         case "setTime": return METHOD;
+        /* <p><b>Deprecated</b> - use setFullYear()</p>
+         * <p>Sets the year as an offset of 1900</p>
+         * @return(number) */
         case "setYear": return METHOD;
-        case "setMilliseconds": return METHOD;
+        /* <p>Sets the day of the month (1-31) according to universal time</p>
+         * @return(number) */
+        case "setUTCDate": return METHOD;
+        /* <p>Sets the year according to universal time</p>
+         * @return(number) */
+        case "setUTCFullYear": return METHOD;
+        /* <p>Sets the milliseconds (0-999) according to universal time</p>
+         * @return(number) */
         case "setUTCMilliseconds": return METHOD;
-        case "setSeconds": return METHOD;
+        /* <p>Sets the seconds (0-59) according to universal time</p>
+         * @return(number) */
         case "setUTCSeconds": return METHOD;
-        case "setMinutes": return METHOD;
+        /* <p>Set the minutes (0-59) according to universal time</p>
+         * @return(number) */
         case "setUTCMinutes": return METHOD;
-        case "setHours": return METHOD;
+        /* <p>Sets the hour (0-23) according to universal time</p>
+         * @return(number) */
         case "setUTCHours": return METHOD;
-        case "setDate": return METHOD;
-        case "setUTCDate": return METHOD;
-        case "setMonth": return METHOD;
+        /* <p>Sets the month (0-11)) according to universal time</p>
+         * @return(number) */
         case "setUTCMonth": return METHOD;
-        case "setFullYear": return METHOD;
-        case "setUTCFullYear": return METHOD;
+        /* <p>Returns a string representing the date portion of the Date 
object</p>
+         * @return(string) */
+        case "toDateString": return METHOD;
+        /* <p><b>Deprecated</b> - use toUTCString()</p>
+         * <p>Throws an exception</p>
+         * @return(error) */
+        case "toGMTString": throw new JSExn("Not implemented");
+        /* <p>Returns a string representing the Date object, using locale 
conventions</p>
+         * @return(string) */
+        case "toLocaleString": return METHOD;
+        /* <p>Returns a string representing the time portion of the Date 
object, using locale conventions</p>
+         * @return(string) */
+        case "toLocaleTimeString": return METHOD;
+        /* <p>Returns a string representing the date portion of the Date 
object, using locale conventions</p>
+         * @return(string) */
+        case "toLocaleDateString": return METHOD;
+        /* <p>Returns a string representing the Date object</p>
+         * @return(string) */
+        case "toString": return METHOD;
+        /* <p>Returns a string representing the time portion of the Date 
object</p>
+         * @return(string) */
+        case "toTimeString": return METHOD;
+        /* <p>Returns a string representing the Date object according to 
universal time</p>
+         * @return(string) */
+        case "toUTCString": return METHOD;
+        /* <p>Returns the primitive value of the Date object</p>
+         * @return(string) */
+        case "valueOf": return METHOD;
         //#end
         return super.get(key);
     }

Modified: trunk/org.vexi-library.js/src/main/jpp/org/vexi/js/VexiJS.jpp
===================================================================
--- trunk/org.vexi-library.js/src/main/jpp/org/vexi/js/VexiJS.jpp       
2011-01-24 22:43:33 UTC (rev 3997)
+++ trunk/org.vexi-library.js/src/main/jpp/org/vexi/js/VexiJS.jpp       
2011-01-25 00:21:11 UTC (rev 3998)
@@ -445,6 +445,7 @@
              * @param(name=size,optional=true)*/ 
             case "Array": return org.ibex.js.JSArray.Constructor;
             case "Boolean": return org.ibex.js.JSNumber.B.Constructor;
+            case "Date": return org.ibex.js.JSDate.Constructor;
             case "Exception": return org.ibex.js.JSExn.Constructor;
             case "Object": return org.ibex.js.JS.Obj.Constructor;
             case "Number": return org.ibex.js.JSNumber.Constructor;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to