blob: 87b3ff834511fbf06921d5efb916e28e1d8fc092 [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>BlockBuilder (Apache Calcite calcite API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.calcite.linq4j.tree, class: BlockBuilder">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../script-dir/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../script-dir/jquery-3.4.1.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-ui.js"></script>
</head>
<body class="class-declaration">
<script type="text/javascript">var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flexBox">
<header role="banner" class="flexHeader">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><b>Apache Calcite</b></div>
</div>
<div class="subNav">
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<div class="navListSearch"><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="skipNav"><a id="skip.navbar.top">
<!-- -->
</a></div>
</nav>
</header>
<div class="flexContent">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.calcite.linq4j.tree</a></div>
<h1 title="Class BlockBuilder" class="title">Class BlockBuilder</h1>
</div>
<div class="contentContainer">
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">java.lang.Object</a>
<div class="inheritance">org.apache.calcite.linq4j.tree.BlockBuilder</div>
</div>
<section class="description">
<hr>
<pre>public class <span class="typeNameLabel">BlockBuilder</span>
extends <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></pre>
<div class="block">Builder for <a href="BlockStatement.html" title="class in org.apache.calcite.linq4j.tree"><code>BlockStatement</code></a>.
<p>Has methods that help ensure that variable names are unique.</p></div>
</section>
<section class="summary">
<ul class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li class="blockList">
<section class="constructorSummary"><a id="constructor.summary">
<!-- -->
</a>
<h2>Constructor Summary</h2>
<div class="memberSummary">
<table>
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<thead>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">BlockBuilder</a></span>()</code></th>
<td class="colLast">
<div class="block">Creates a non-optimizing BlockBuilder.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(boolean)">BlockBuilder</a></span>&#8203;(boolean&nbsp;optimizing)</code></th>
<td class="colLast">
<div class="block">Creates a BlockBuilder.</div>
</td>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(boolean,org.apache.calcite.linq4j.tree.BlockBuilder)">BlockBuilder</a></span>&#8203;(boolean&nbsp;optimizing,
<a href="BlockBuilder.html" title="class in org.apache.calcite.linq4j.tree">BlockBuilder</a>&nbsp;parent)</code></th>
<td class="colLast">
<div class="block">Creates a BlockBuilder.</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li class="blockList">
<section class="methodSummary"><a id="method.summary">
<!-- -->
</a>
<h2>Method Summary</h2>
<div class="memberSummary">
<div role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="memberSummary_tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="activeTableTab">All Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t2" class="tableTab" onclick="show(2);">Instance Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t4" class="tableTab" onclick="show(8);">Concrete Methods</button></div>
<div id="memberSummary_tabpanel" role="tabpanel">
<table aria-labelledby="t0">
<thead>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr class="altColor" id="i0">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#add(org.apache.calcite.linq4j.tree.Expression)">add</a></span>&#8203;(<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>&nbsp;expression)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#add(org.apache.calcite.linq4j.tree.Statement)">add</a></span>&#8203;(<a href="Statement.html" title="class in org.apache.calcite.linq4j.tree">Statement</a>&nbsp;statement)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addExpressionForReuse(org.apache.calcite.linq4j.tree.DeclarationStatement)">addExpressionForReuse</a></span>&#8203;(<a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a>&nbsp;decl)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code><a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#append(java.lang.String,org.apache.calcite.linq4j.tree.BlockStatement)">append</a></span>&#8203;(<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;name,
<a href="BlockStatement.html" title="class in org.apache.calcite.linq4j.tree">BlockStatement</a>&nbsp;block)</code></th>
<td class="colLast">
<div class="block">Appends a block to a list of statements and returns an expression
(possibly a variable) that represents the result of the newly added
block.</div>
</td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code><a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#append(java.lang.String,org.apache.calcite.linq4j.tree.BlockStatement,boolean)">append</a></span>&#8203;(<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;name,
<a href="BlockStatement.html" title="class in org.apache.calcite.linq4j.tree">BlockStatement</a>&nbsp;block,
boolean&nbsp;optimize)</code></th>
<td class="colLast">
<div class="block">Appends an expression to a list of statements, optionally optimizing it
to a variable if it is used more than once.</div>
</td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code><a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#append(java.lang.String,org.apache.calcite.linq4j.tree.Expression)">append</a></span>&#8203;(<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;name,
<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>&nbsp;expression)</code></th>
<td class="colLast">
<div class="block">Appends an expression to a list of statements, and returns an expression
(possibly a variable) that represents the result of the newly added
block.</div>
</td>
</tr>
<tr class="altColor" id="i6">
<td class="colFirst"><code><a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#append(java.lang.String,org.apache.calcite.linq4j.tree.Expression,boolean)">append</a></span>&#8203;(<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;name,
<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>&nbsp;expression,
boolean&nbsp;optimize)</code></th>
<td class="colLast">
<div class="block">Appends an expression to a list of statements, optionally optimizing if
the expression is used more than once.</div>
</td>
</tr>
<tr class="rowColor" id="i7">
<td class="colFirst"><code><a href="BlockBuilder.html" title="class in org.apache.calcite.linq4j.tree">BlockBuilder</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#append(org.apache.calcite.linq4j.tree.Expression)">append</a></span>&#8203;(<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>&nbsp;expression)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor" id="i8">
<td class="colFirst"><code><a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#appendIfNotNull(java.lang.String,org.apache.calcite.linq4j.tree.Expression)">appendIfNotNull</a></span>&#8203;(<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;name,
<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>&nbsp;expression)</code></th>
<td class="colLast">
<div class="block">Appends an expression to a list of statements, if it is not null.</div>
</td>
</tr>
<tr class="rowColor" id="i9">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#clear()">clear</a></span>()</code></th>
<td class="colLast">
<div class="block">Clears this BlockBuilder.</div>
</td>
</tr>
<tr class="altColor" id="i10">
<td class="colFirst"><code>protected <a href="Shuttle.html" title="class in org.apache.calcite.linq4j.tree">Shuttle</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#createFinishingOptimizeShuttle()">createFinishingOptimizeShuttle</a></span>()</code></th>
<td class="colLast">
<div class="block">Creates a final optimization shuttle.</div>
</td>
</tr>
<tr class="rowColor" id="i11">
<td class="colFirst"><code>protected <a href="Shuttle.html" title="class in org.apache.calcite.linq4j.tree">Shuttle</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#createOptimizeShuttle()">createOptimizeShuttle</a></span>()</code></th>
<td class="colLast">
<div class="block">Creates a shuttle that will be used during block optimization.</div>
</td>
</tr>
<tr class="altColor" id="i12">
<td class="colFirst"><code><a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getComputedExpression(org.apache.calcite.linq4j.tree.Expression)">getComputedExpression</a></span>&#8203;(<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>&nbsp;expr)</code></th>
<td class="colLast">
<div class="block">Returns the reference to ParameterExpression if given expression was
already computed and stored to local variable.</div>
</td>
</tr>
<tr class="rowColor" id="i13">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hasVariable(java.lang.String)">hasVariable</a></span>&#8203;(<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;name)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor" id="i14">
<td class="colFirst"><code>protected boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isSafeForReuse(org.apache.calcite.linq4j.tree.DeclarationStatement)">isSafeForReuse</a></span>&#8203;(<a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a>&nbsp;decl)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor" id="i15">
<td class="colFirst"><code>protected boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isSimpleExpression(org.apache.calcite.linq4j.tree.Expression)">isSimpleExpression</a></span>&#8203;(<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>&nbsp;expr)</code></th>
<td class="colLast">
<div class="block">Checks if expression is simple enough to always inline at zero cost.</div>
</td>
</tr>
<tr class="altColor" id="i16">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newName(java.lang.String)">newName</a></span>&#8203;(<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;suggestion)</code></th>
<td class="colLast">
<div class="block">Creates a name for a new variable, unique within this block.</div>
</td>
</tr>
<tr class="rowColor" id="i17">
<td class="colFirst"><code><a href="BlockStatement.html" title="class in org.apache.calcite.linq4j.tree">BlockStatement</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toBlock()">toBlock</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a block consisting of the current list of statements.</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="inheritedList">
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3>
<a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a><code><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li class="blockList">
<section class="constructorDetails"><a id="constructor.detail">
<!-- -->
</a>
<h2>Constructor Details</h2>
<ul class="blockList">
<li class="blockList">
<section class="detail">
<h3><a id="&lt;init&gt;()">BlockBuilder</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="memberName">BlockBuilder</span>()</div>
<div class="block">Creates a non-optimizing BlockBuilder.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="&lt;init&gt;(boolean)">BlockBuilder</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="memberName">BlockBuilder</span>&#8203;(<span class="arguments">boolean&nbsp;optimizing)</span></div>
<div class="block">Creates a BlockBuilder.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>optimizing</code> - Whether to eliminate common sub-expressions</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="&lt;init&gt;(boolean,org.apache.calcite.linq4j.tree.BlockBuilder)">BlockBuilder</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="memberName">BlockBuilder</span>&#8203;(<span class="arguments">boolean&nbsp;optimizing,
<a href="BlockBuilder.html" title="class in org.apache.calcite.linq4j.tree">BlockBuilder</a>&nbsp;parent)</span></div>
<div class="block">Creates a BlockBuilder.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>optimizing</code> - Whether to eliminate common sub-expressions</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li class="blockList">
<section class="methodDetails"><a id="method.detail">
<!-- -->
</a>
<h2>Method Details</h2>
<ul class="blockList">
<li class="blockList">
<section class="detail">
<h3><a id="clear()">clear</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">void</span>&nbsp;<span class="memberName">clear</span>()</div>
<div class="block">Clears this BlockBuilder.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="append(java.lang.String,org.apache.calcite.linq4j.tree.BlockStatement)">append</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a></span>&nbsp;<span class="memberName">append</span>&#8203;(<span class="arguments"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;name,
<a href="BlockStatement.html" title="class in org.apache.calcite.linq4j.tree">BlockStatement</a>&nbsp;block)</span></div>
<div class="block">Appends a block to a list of statements and returns an expression
(possibly a variable) that represents the result of the newly added
block.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="append(java.lang.String,org.apache.calcite.linq4j.tree.BlockStatement,boolean)">append</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a></span>&nbsp;<span class="memberName">append</span>&#8203;(<span class="arguments"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;name,
<a href="BlockStatement.html" title="class in org.apache.calcite.linq4j.tree">BlockStatement</a>&nbsp;block,
boolean&nbsp;optimize)</span></div>
<div class="block">Appends an expression to a list of statements, optionally optimizing it
to a variable if it is used more than once.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - Suggested variable name</dd>
<dd><code>block</code> - Expression</dd>
<dd><code>optimize</code> - Whether to try to optimize by assigning the expression to
a variable. Do not do this if the expression has
side-effects or a time-dependent value.</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="append(java.lang.String,org.apache.calcite.linq4j.tree.Expression)">append</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a></span>&nbsp;<span class="memberName">append</span>&#8203;(<span class="arguments"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;name,
<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>&nbsp;expression)</span></div>
<div class="block">Appends an expression to a list of statements, and returns an expression
(possibly a variable) that represents the result of the newly added
block.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="appendIfNotNull(java.lang.String,org.apache.calcite.linq4j.tree.Expression)">appendIfNotNull</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a></span>&nbsp;<span class="memberName">appendIfNotNull</span>&#8203;(<span class="arguments"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;name,
<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>&nbsp;expression)</span></div>
<div class="block">Appends an expression to a list of statements, if it is not null.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="append(java.lang.String,org.apache.calcite.linq4j.tree.Expression,boolean)">append</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a></span>&nbsp;<span class="memberName">append</span>&#8203;(<span class="arguments"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;name,
<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>&nbsp;expression,
boolean&nbsp;optimize)</span></div>
<div class="block">Appends an expression to a list of statements, optionally optimizing if
the expression is used more than once.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="isSimpleExpression(org.apache.calcite.linq4j.tree.Expression)">isSimpleExpression</a></h3>
<div class="memberSignature"><span class="modifiers">protected</span>&nbsp;<span class="returnType">boolean</span>&nbsp;<span class="memberName">isSimpleExpression</span>&#8203;(<span class="arguments"><a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>&nbsp;expr)</span></div>
<div class="block">Checks if expression is simple enough to always inline at zero cost.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>expr</code> - expression to test</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true when given expression is safe to always inline</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="isSafeForReuse(org.apache.calcite.linq4j.tree.DeclarationStatement)">isSafeForReuse</a></h3>
<div class="memberSignature"><span class="modifiers">protected</span>&nbsp;<span class="returnType">boolean</span>&nbsp;<span class="memberName">isSafeForReuse</span>&#8203;(<span class="arguments"><a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a>&nbsp;decl)</span></div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="addExpressionForReuse(org.apache.calcite.linq4j.tree.DeclarationStatement)">addExpressionForReuse</a></h3>
<div class="memberSignature"><span class="modifiers">protected</span>&nbsp;<span class="returnType">void</span>&nbsp;<span class="memberName">addExpressionForReuse</span>&#8203;(<span class="arguments"><a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a>&nbsp;decl)</span></div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="getComputedExpression(org.apache.calcite.linq4j.tree.Expression)">getComputedExpression</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a></span>&nbsp;<span class="memberName">getComputedExpression</span>&#8203;(<span class="arguments"><a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>&nbsp;expr)</span></div>
<div class="block">Returns the reference to ParameterExpression if given expression was
already computed and stored to local variable.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>expr</code> - expression to test</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>existing ParameterExpression or null</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="add(org.apache.calcite.linq4j.tree.Statement)">add</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">void</span>&nbsp;<span class="memberName">add</span>&#8203;(<span class="arguments"><a href="Statement.html" title="class in org.apache.calcite.linq4j.tree">Statement</a>&nbsp;statement)</span></div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="add(org.apache.calcite.linq4j.tree.Expression)">add</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">void</span>&nbsp;<span class="memberName">add</span>&#8203;(<span class="arguments"><a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>&nbsp;expression)</span></div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="toBlock()">toBlock</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="BlockStatement.html" title="class in org.apache.calcite.linq4j.tree">BlockStatement</a></span>&nbsp;<span class="memberName">toBlock</span>()</div>
<div class="block">Returns a block consisting of the current list of statements.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="createOptimizeShuttle()">createOptimizeShuttle</a></h3>
<div class="memberSignature"><span class="modifiers">protected</span>&nbsp;<span class="returnType"><a href="Shuttle.html" title="class in org.apache.calcite.linq4j.tree">Shuttle</a></span>&nbsp;<span class="memberName">createOptimizeShuttle</span>()</div>
<div class="block">Creates a shuttle that will be used during block optimization.
Sub-classes might provide more specific optimizations (e.g. partial
evaluation).</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>shuttle used to optimize the statements when converting to block</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="createFinishingOptimizeShuttle()">createFinishingOptimizeShuttle</a></h3>
<div class="memberSignature"><span class="modifiers">protected</span>&nbsp;<span class="returnType"><a href="Shuttle.html" title="class in org.apache.calcite.linq4j.tree">Shuttle</a></span>&nbsp;<span class="memberName">createFinishingOptimizeShuttle</span>()</div>
<div class="block">Creates a final optimization shuttle.
Typically, the visitor will factor out constant expressions.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>shuttle that is used to finalize the optimization</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="newName(java.lang.String)">newName</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></span>&nbsp;<span class="memberName">newName</span>&#8203;(<span class="arguments"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;suggestion)</span></div>
<div class="block">Creates a name for a new variable, unique within this block.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="hasVariable(java.lang.String)">hasVariable</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">boolean</span>&nbsp;<span class="memberName">hasVariable</span>&#8203;(<span class="arguments"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;name)</span></div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="append(org.apache.calcite.linq4j.tree.Expression)">append</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="BlockBuilder.html" title="class in org.apache.calcite.linq4j.tree">BlockBuilder</a></span>&nbsp;<span class="memberName">append</span>&#8203;(<span class="arguments"><a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>&nbsp;expression)</span></div>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
</div>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><b>Apache Calcite</b></div>
</div>
<div class="subNav">
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &copy; 2012-2020 Apache Software Foundation. All Rights Reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>