commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r394443 - /jakarta/commons/proper/jexl/trunk/xdocs/reference/syntax.xml
Date Sun, 16 Apr 2006 08:35:07 GMT
Author: dion
Date: Sun Apr 16 01:35:04 2006
New Revision: 394443

URL: http://svn.apache.org/viewcvs?rev=394443&view=rev
Log:
Add bitwise operators, conditionals

Modified:
    jakarta/commons/proper/jexl/trunk/xdocs/reference/syntax.xml

Modified: jakarta/commons/proper/jexl/trunk/xdocs/reference/syntax.xml
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jexl/trunk/xdocs/reference/syntax.xml?rev=394443&r1=394442&r2=394443&view=diff
==============================================================================
--- jakarta/commons/proper/jexl/trunk/xdocs/reference/syntax.xml (original)
+++ jakarta/commons/proper/jexl/trunk/xdocs/reference/syntax.xml Sun Apr 16 01:35:04 2006
@@ -29,6 +29,7 @@
           <li><a href="#Literals">Literals</a></li>
           <li><a href="#Functions">Functions</a></li>
           <li><a href="#Operators">Operators</a></li>
+          <li><a href="#Conditional">Conditional Statements</a></li>
         </ol>
       </p>
       <p>
@@ -71,7 +72,7 @@
         <tr>
           <td>Scripts</td>
           <td>
-            A script in Jexl is made up of zero or more statements.
+            A script in Jexl is made up of zero or more statements. Scripts can be read from
a String, File or URL.
           </td>
         </tr>
         <tr>
@@ -189,10 +190,38 @@
           </td>
         </tr>
         <tr>
+          <td>Bitwise <code>and</code></td>
+          <td>
+            The usual <code>&amp;</code> operator is used, e.g. 
+            <source>33 &amp; 4</source>, 0010 0001 &amp; 0000 0100 =
0.
+          </td>
+        </tr>
+        <tr>
+          <td>Bitwise <code>or</code></td>
+          <td>
+            The usual <code>|</code> operator is used, e.g.
+            <source>33 | 4</source>, 0010 0001 | 0000 0100 = 0010 0101 = 37.
+          </td>
+        </tr>
+        <tr>
+          <td>Bitwise <code>xor</code></td>
+          <td>
+            The usual <code>^</code> operator is used, e.g.
+            <source>33 ^ 4</source>, 0010 0001 ^ 0000 0100 = 0010 0100 = 37.
+          </td>
+        </tr>
+        <tr>
+          <td>Bitwise <code>complement</code></td>
+          <td>
+            The usual <code>~</code> operator is used, e.g.
+            <source>~33</source>, ~0010 0001 = 1101 1110 = -34.
+          </td>
+        </tr>
+        <tr>
           <td>Equality</td>
           <td>
             The usual <code>==</code> operator can be used as well as the abbreviation
<code>eq</code>.
-            For example
+            For example 
             <source>val1 == val2</source> and
             <source>val1 eq val2</source> are equivalent.
             <ol>
@@ -315,6 +344,34 @@
         </tr>
       </table>
     </section>
+    <section name="Conditional">
+      <table>
+        <tr><th width="15%">Operator</th><th>Description</th></tr>
+        <tr>
+          <td>if</td>
+          <td>
+            Classic, if/else statement, e.g.
+            <code>if ((x * 2) == 5) {y = 1;} else {y = 2;}</code>
+          </td>
+        </tr>
+        <tr>
+          <td>foreach</td>
+          <td>
+            Loop through items of an Array, Collection, Map, Iterator or Enumeration, e.g.
+            <code>foreach (item in list) { x = x + item; }</code>
+            Where <code>item</code> and <code>list</code> are variables.
+          </td>
+        </tr>
+        <tr>
+          <td>while</td>
+          <td>
+            Loop until a condition is satisfied, e.g.
+            <code>while (x lt 10) { x = x + 2; }</code>
+          </td>
+        </tr>
+      </table>
+    </section>
+
   </body>
 </document>
     



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message