Revision: 4019 http://vexi.svn.sourceforge.net/vexi/?rev=4019&view=rev Author: clrg Date: 2011-02-04 16:57:05 +0000 (Fri, 04 Feb 2011)
Log Message: ----------- More docs Modified Paths: -------------- trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/JS.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/JS.jpp =================================================================== --- trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/JS.jpp 2011-02-04 00:40:41 UTC (rev 4018) +++ trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/JS.jpp 2011-02-04 16:57:05 UTC (rev 4019) @@ -851,14 +851,16 @@ /*@PAGE(varname=ProxyList,humanname=ProxyList Object) * * <p>The proxy list object is an alternative list object to the standard js array, - * which supports a 'range trap' 'Elements' to trap on the - * accessing/adding/removing of elements</p> + * which supports a “range trap” lsquo;Elementsrsquo; to trap on the + * access/assignment/removal of elements</p> * - * <p>Whereas the Proxy is very similar to the standard Object the ProxyList is not - * similar to an array and so cannot be used as a drop in replacement. Notably - * it does not support most of the methods that arrays have, and it is not sparse - * and cannot contain nulls. Putting null to a proxy list will remove the object - * at the index.</p> + * <p>Whereas the Proxy object is very similar to the standard Object the ProxyList is not + * similar to an array and so cannot be used as a drop in replacement.<p> + * + * <p>Notably, ProxyList does not support most of the methods that arrays have, and + * it is not sparse and cannot contain nulls. Putting null to a proxy list will remove + * the object at the index. In this regard, a ProxyList object is similar to a Box in + * the way it handles manipulation of its contents.</p> * */ /* The length of the ProxyList @type(Number) @initial_value(varies,code=false) */ @@ -880,10 +882,10 @@ * <p>Placing a trap on this allows the interception of all read and writes to this * proxylist object</p> * - * <pre> // a (range) read trap - * proxylist.Elements ++= function() { }; - * // a (range) write trap - * proxylist.Elements ++= function(v) { };</pre> + * <pre>// a (range) read trap + *proxylist.Elements ++= function() { }; + *// a (range) write trap + *proxylist.Elements ++= function(v) { };</pre> * * @initial_value(N/A,code=false) * @type(<i>N/A</i>) 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-02-04 00:40:41 UTC (rev 4018) +++ trunk/org.vexi-library.js/src/main/jpp/org/vexi/js/VexiJS.jpp 2011-02-04 16:57:05 UTC (rev 4019) @@ -13,6 +13,9 @@ import org.ibex.util.Basket.Stack; import org.ibex.util.*; +/** Implements a js helper object that is usually globally accessible + * i.e. as part of the 'vexi' object + **/ public class VexiJS implements Constants { // REMARK - need to make Schedule available, alternatives are instantiate or // rely on thread local @@ -123,7 +126,7 @@ * @return(type=String) */ case "decodeURI": return METHOD; - /* <p> Decodes a Uniform Resource Identifier (URI) componentby replacing + /* <p>Decodes a Uniform Resource Identifier (URI) componentby replacing * each escape sequence, representing a UTF-8 encoding of a character, * with the character it represents. </p> * @@ -143,7 +146,7 @@ * @return(type=String) */ case "encodeURI": return METHOD; - /* <p> Encodes a Uniform Resource Identifier (URI) component by replacing + /* <p>Encodes a Uniform Resource Identifier (URI) component by replacing * each instance of certain characters by one, two, or three escape sequences * representing the UTF-8 encoding of the character. </p> * @@ -216,62 +219,106 @@ public JS get(JS key) throws JSExn { //#switch(JSU.toString(key)) - /*@PAGE(varname=math,humanname=Math Library Object) */ + /*@PAGE(varname=math,humanname=Math Library Object) + * + * <p>The standard JS Math object, accessible as <code>vexi.math</code>, with the + * addition of methods ‘isNaN’ and ‘isFinite’, and Number + * objects ‘NaN’ and ‘Infinity’.</p> + * */ + + /* The constant ‘e’ + * @type(Number) */ case "E": return E; + /* The result of <code>ln(10)</code> + * @type(Number) */ case "LN10": return LN10; + /* The result of <code>ln(2)</code> + * @type(Number) */ case "LN2": return LN2; + /* The result of <code>log10(e)</code> + * @type(Number) */ case "LOG10E": return LOG10E; + /* The result of <code>log2(e)</code> + * @type(Number) */ case "LOG2E": return LOG2E; + /* The constant ‘pi’ + * @type(Number) */ case "PI": return PI; + /* The result of <code>1 / sqrt(2)</code> + * @type(Number) */ case "SQRT1_2": return SQRT1_2; + /* The result of <code>sqrt(2)</code> + * @type(Number) */ case "SQRT2": return SQRT2; - - /* The Number that represents a non-representable number e.g. 1/0. @Type(Number) */ + /* The Number object that represents a non-representable number e.g. 1/0 + * @type(Number) */ case "NaN": return NC_NaN; - /* The Number that represents a infinity. @Type(Number) */ + /* The Number that represents a infinity + * @type(Number) */ case "Infinity": return NC_Infinity; - - /* Returns the absolute value of num. @param(num) @return(Number) */ + /* Returns the absolute value of ‘num’ + * @param(num) @return(Number) */ case "abs": return METHOD; - /* Returns the arc cosine of num, in radians. @param(num) @return(Number) */ + /* Returns the arc cosine of ‘num’ in radians + * @param(num) @return(Number) */ case "acos": return METHOD; - /* Returns the arc sine of num, in radians. @param(num) @return(Number) */ + /* Returns the arc sine of ‘num’ in radians + * @param(num) @return(Number) */ case "asin": return METHOD; - /* Returns the arc tangent of num, in radians. @param(num) @return(Number) */ + /* Returns the arc tangent of ‘num’ in radians + * @param(num) @return(Number) */ case "atan": return METHOD; - /* Converts the rectangular coordinates x, y into polar coordinates and returns - * the angle portion of the polar coordinates. @param(x) @param(y) @return(Number) */ + /* Converts the rectangular coordinates ‘x, y’ into polar coordinates and + * returns the angle portion of the polar coordinates + * @param(x) @param(y) @return(Number) */ case "atan2": return METHOD; - /* Returns the smallest integer that is larger than num. @param(num) @return(Number) */ + /* Returns the smallest integer that is larger than ‘num’ + * @param(num) @return(Number) */ case "ceil": return METHOD; - /* Returns the cosine of num where num is in radians. @param(num) @return(Number) */ + /* Returns the cosine of num where ‘num’ is in radians + * @param(num) @return(Number) */ case "cos": return METHOD; - /* Returns e^num (e raised to the power num.) @param(num) @return(Number) */ + /* Returns <code>e^num</code> (‘e’ raised to the power ‘num’) + * @param(num) @return(Number) */ case "exp": return METHOD; - /* Returns the largest integer that is smaller than value. @param(num) @return(Number) */ + /* Returns the largest integer that is smaller than lsquo;num’ + * @param(num) @return(Number) */ case "floor": return METHOD; - /* Returns true if num represents infinity i.e. equals the Infinity object. @param(num) @return(Boolean) */ + /* Returns <code>true</code> if ‘num’ represents a finite number + * i.e. is not the <code>vexi.math.Infinity</code> object + * @param(num) @return(Boolean) */ case "isFinite": return METHOD; - /* Returns true if num is not a number i.e. equals the vexi.math.NaN object. @param(num) @return(Boolean) */ + /* Returns <code>true</code> if ‘num’ is not a number + * i.e. equals the <code>vexi.math.NaN</code> object + * @param(num) @return(Boolean) */ case "isNaN": return METHOD; - /* Returns the natural logarithm of value, ln(num). @param(num) @return(Number) */ + /* Returns the natural logarithm of ‘num’ i.e. <code>ln(num)</code> + * @param(num) @return(Number) */ case "log": return METHOD; - /* Returns the greater of n1 and n2. @param(n1) @param(n2) @return(Number) */ + /* Returns the greater of ‘n1’ and ‘n2’ + * @param(n1) @param(n2) @return(Number) */ case "max": return METHOD; - /* Returns the lesser of n1 and n2. @param(n1) @param(n2) @return(Number) */ + /* Returns the lesser of ‘n1’ and ‘n2’ + * @param(n1) @param(n2) @return(Number) */ case "min": return METHOD; - /* Returns num^p (num raised to the power p). @param(num) @return(Number) */ + /* Returns <code>num^p</code> (‘num’ raised to the power ‘p’) + * @param(num) @return(Number) */ case "pow": return METHOD; - /* Returns a random floating-point number between 0 and 1. @param(num) @return(Number) */ + /* Returns a random floating-point number between 0 and 1 + * @param(num) @return(Number) */ case "random": return METHOD; - /* Returns the closest integer to num. @param(num) @return(Number) */ + /* Returns the closest integer to ‘num’ + * @param(num) @return(Number) */ case "round": return METHOD; - /* Returns the sine of num where num is in radians. @param(num) @return(Number) */ + /* Returns the sine of num where ‘num’ is in radians + * @param(num) @return(Number) */ case "sin": return METHOD; - /* Returns the square root of num. @param(num) @return(Number) */ + /* Returns the square root of ‘num’ + * @param(num) @return(Number) */ case "sqrt": return METHOD; - /* Returns the tangent of num where num is in radians. @param(num) @return(Number) */ + /* Returns the tangent of num where ‘num’ is in radians + * @param(num) @return(Number) */ case "tan": return METHOD; //#end return super.get(key); @@ -327,19 +374,53 @@ public JS get(JS key) throws JSExn { //#switch(JSU.toString(key)) /*@PAGE(varname=stream,humanname=Stream Library Object) */ + /* <p>Returns a buffer optionally initialized with the contents of ‘stream’</p> + * + * @param(name=stream,optional=true) + * @return(Stream) + * */ case "buffer": return METHOD; + /* <p>Combines the input streams and returns a single stream representing the + * combination of the input streams</p> + * + * @param(stream1) + * @param(stream2) + * @param(name=streamN,optional=true) + * @return(Stream) + * */ case "multiple": return METHOD; + /* <p>Returns the canonical name of the input ‘stream’ i.e. its filename or URI</p> + * + * @param(stream) + * @return(Stream) + * */ case "nameOf": return METHOD; + /* <p>Pipe the contents of stream ‘source’ to stream ‘destination’</p> + * + * @param(source) + * @param(destination) + * @return(Stream) + * */ case "pipe": return METHOD; - /* <p>Turns the specified string into a stream.</p> + /* <p>Turns the specified string into a stream</p> * * @param(string) * @return(Stream) * */ case "fromString": return METHOD; + /* <p>Returns the extracted contents of ‘zipfile’ as a Stream object</p> + * + * @param(zipfile) + * @return(Stream) + * */ case "unzip": return METHOD; + /* <p>Returns the extracted contents of ‘cabfile’ as a Stream object</p> + * + * @param(cabfile) + * @return(Stream) + * */ case "uncab": return METHOD; - /* <p>Provides a stream accessing content from the provided url.</p> + /* <p>Provides a stream accessing content from the provided url</p> * * @param(url) * @return(Stream) @@ -368,11 +449,6 @@ return super.get(key); } public JS callMethod(JS this_, JS method, JS[] args) throws JSExn { - //#switch(JSU.toString(method)) - case "buffer": return new Fountain.ByteArray(args.length>0?args[0]:null); - case "multiple": return Fountain.multiple(args); - //#end - switch(args.length) { case 1: { //#switch(JSU.toString(method)) @@ -397,6 +473,10 @@ //#end } } + //#switch(JSU.toString(method)) + case "buffer": return new Fountain.ByteArray(args.length>0?args[0]:null); + case "multiple": return Fountain.multiple(args); + //#end return super.callMethod(this_, method, args); } }; @@ -801,7 +881,6 @@ throw JSU.handleFountainExn(e); } } - - -} \ No newline at end of file + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ The modern datacenter depends on network connectivity to access resources and provide services. The best practices for maximizing a physical server's connectivity to a physical network are well understood - see how these rules translate into the virtual world? http://p.sf.net/sfu/oracle-sfdevnlfb _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn