Files
doc-exports/docs/dataartsstudio/umn/dataartsstudio_01_0495.html
Xiong, Chen Xiao f3ee29a3dd DataArts UMN 20230329 version
Reviewed-by: Rechenburg, Matthias <matthias.rechenburg@t-systems.com>
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Xiong, Chen Xiao <chenxiaoxiong@huawei.com>
Co-committed-by: Xiong, Chen Xiao <chenxiaoxiong@huawei.com>
2023-05-11 17:09:25 +00:00

121 lines
10 KiB
HTML

<a name="dataartsstudio_01_0495"></a><a name="dataartsstudio_01_0495"></a>
<h1 class="topictitle1">Basic Operators</h1>
<div id="body8662426"><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p8060118">EL supports most of the arithmetic and logic operators provided by Java.</p>
<div class="section" id="dataartsstudio_01_0495__en-us_topic_0132846496_section18795752204420"><h4 class="sectiontitle">Operator List</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dataartsstudio_01_0495__en-us_topic_0132846496_table1464919156479" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Basic operators</caption><thead align="left"><tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row1364919151479"><th align="left" class="cellrowborder" valign="top" width="34%" id="mcps1.3.2.2.2.3.1.1"><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p19649171514713"><strong id="dataartsstudio_01_0495__en-us_topic_0132846496_b842352706193442">Operator</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="66%" id="mcps1.3.2.2.2.3.1.2"><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p13649151514712">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row1264961514477"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p2649515174710">.</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p156491915174719">Accesses a Bean property or a mapping entry.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row1649121517476"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p1764920157478">[]</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p1364931518476">Accesses an array or linked list.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row364911152478"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p66491015104710">()</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p1764914151473">Organizes a subexpression to change priority.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row46491515194716"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p8649161519472">+</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p176491515174713">Plus sign</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row164912154479"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p1664913158474">-</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p1564921534717">Minus or negative sign</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row36494157476"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p19649151517476">*</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p664951518478">Multiplication sign</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row264961512472"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p4649615144719">/ or div</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p14649215154712">Division sign</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row1764915155473"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p186491215134713">% or mod</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p116492157475">Modulo</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row5649121584715"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p1664921524711">== or eq</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p10649415184719">Test whether equal to.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row264901511477"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p156491315124714">!= or ne</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p4649161519478">Test whether unequal to.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row3649181544710"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p364921574716">&lt; or lt</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p6649615164712">Test whether less than.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row56491415104714"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p96491915144712">&gt; or gt</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p1564911544716">Test whether greater than.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row464931594718"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p364918154472">&lt;= or le</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p14649101594711">Check whether less than or equal to.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row15649171516479"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p764971534719">&gt;= or ge</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p86498151479">Test whether greater than or equal to.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row1664961534717"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p96491915114718">&amp;&amp; or and</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p16649121544719">Test logic and.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row1364911510475"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p166491115104715">|| or or</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p126491615184714">Test logic or.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row26491715194714"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p14649151564711">! or not</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p1964915155470">Test negation.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row17649715134710"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p1564941514718">empty</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p10649215104716">Test whether empty.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0495__en-us_topic_0132846496_row36497152477"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.3.1.1 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p664911158478">?:</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.3.2.2.2.3.1.2 "><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p15418114991315">The expression is similar to if else. If the statement in front of ? is true, the value of the expression between ? and : is returned. Otherwise, the value following : is returned.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="dataartsstudio_01_0495__en-us_topic_0132846496_section19511226104517"><h4 class="sectiontitle"><strong id="dataartsstudio_01_0495__en-us_topic_0132846496_b1575119018142">Example</strong></h4><p id="dataartsstudio_01_0495__en-us_topic_0132846496_p65361654133315">If variable a is empty, default is returned. If variable a is not empty, a itself is returned. The EL expression is as follows:</p>
<pre class="screen" id="dataartsstudio_01_0495__en-us_topic_0132846496_screen1148123313579">#{empty a?"default":a}</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dataartsstudio_01_0493.html">EL Expression Reference</a></div>
</div>
</div>