| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc --> |
| <title>BlockBuilder (Apache Calcite API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="BlockBuilder (Apache Calcite API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| 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,"i18":10,"i19":10,"i20":10,"i21":10,"i22":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 = "../../../../../"; |
| var useModuleDirectories = true; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= 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="class-use/BlockBuilder.html">Use</a></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> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.calcite.linq4j.tree</a></div> |
| <h2 title="Class BlockBuilder" class="title">Class BlockBuilder</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li>java.lang.Object</li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.calcite.linq4j.tree.BlockBuilder</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <pre>public class <span class="typeNameLabel">BlockBuilder</span> |
| extends java.lang.Object</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> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="nested.class.summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Class</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>private static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="BlockBuilder.InlineVariableVisitor.html" title="class in org.apache.calcite.linq4j.tree">BlockBuilder.InlineVariableVisitor</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Inline Variable Visitor.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>private static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="BlockBuilder.Slot.html" title="class in org.apache.calcite.linq4j.tree">BlockBuilder.Slot</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Holds the number of times a declaration was used.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>private static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="BlockBuilder.SubstituteVariableVisitor.html" title="class in org.apache.calcite.linq4j.tree">BlockBuilder.SubstituteVariableVisitor</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Substitute Variable Visitor.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>private static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="BlockBuilder.UseCounter.html" title="class in org.apache.calcite.linq4j.tree">BlockBuilder.UseCounter</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Use counter.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Field</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>(package private) java.util.Map<<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>,​<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="#expressionForReuse">expressionForReuse</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Contains final-fine-to-reuse-declarations.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>private static <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="#OPTIMIZE_SHUTTLE">OPTIMIZE_SHUTTLE</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>private boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#optimizing">optimizing</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>private <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="#parent">parent</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>(package private) java.util.List<<a href="Statement.html" title="class in org.apache.calcite.linq4j.tree">Statement</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#statements">statements</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>(package private) java.util.Set<java.lang.String></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#variables">variables</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <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>​(boolean 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>​(boolean optimizing, |
| <a href="BlockBuilder.html" title="class in org.apache.calcite.linq4j.tree">BlockBuilder</a> parent)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a BlockBuilder.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <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> |
| <tr id="i0" class="altColor"> |
| <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>​(<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> expression)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <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>​(<a href="Statement.html" title="class in org.apache.calcite.linq4j.tree">Statement</a> statement)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <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>​(<a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a> decl)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <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>​(java.lang.String name, |
| <a href="BlockStatement.html" title="class in org.apache.calcite.linq4j.tree">BlockStatement</a> 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 id="i4" class="altColor"> |
| <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>​(java.lang.String name, |
| <a href="BlockStatement.html" title="class in org.apache.calcite.linq4j.tree">BlockStatement</a> block, |
| boolean 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 id="i5" class="rowColor"> |
| <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>​(java.lang.String name, |
| <a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> 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 id="i6" class="altColor"> |
| <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>​(java.lang.String name, |
| <a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> expression, |
| boolean 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 id="i7" class="rowColor"> |
| <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>​(<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> expression)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>private <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>​(java.lang.String name, |
| <a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> expression, |
| boolean optimize)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <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>​(java.lang.String name, |
| <a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> 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 id="i10" class="altColor"> |
| <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 id="i11" class="rowColor"> |
| <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 id="i12" class="altColor"> |
| <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 id="i13" class="rowColor"> |
| <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>​(<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> 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 id="i14" class="altColor"> |
| <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>​(java.lang.String name)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code>private boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isCostly(org.apache.calcite.linq4j.tree.DeclarationStatement)">isCostly</a></span>​(<a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a> decl)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i16" class="altColor"> |
| <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>​(<a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a> decl)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i17" class="rowColor"> |
| <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>​(<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> 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 id="i18" class="altColor"> |
| <td class="colFirst"><code>java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newName(java.lang.String)">newName</a></span>​(java.lang.String suggestion)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a name for a new variable, unique within this block.</div> |
| </td> |
| </tr> |
| <tr id="i19" class="rowColor"> |
| <td class="colFirst"><code>private java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newName(java.lang.String,boolean)">newName</a></span>​(java.lang.String suggestion, |
| boolean optimize)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a name for a new variable, unique within this block, controlling |
| whether the variable can be inlined later.</div> |
| </td> |
| </tr> |
| <tr id="i20" class="altColor"> |
| <td class="colFirst"><code>private <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="#normalizeDeclaration(org.apache.calcite.linq4j.tree.DeclarationStatement)">normalizeDeclaration</a></span>​(<a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a> decl)</code></th> |
| <td class="colLast"> |
| <div class="block">Prepares declaration for inlining: adds cast</div> |
| </td> |
| </tr> |
| <tr id="i21" class="rowColor"> |
| <td class="colFirst"><code>private boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#optimize(org.apache.calcite.linq4j.tree.Shuttle,boolean)">optimize</a></span>​(<a href="Shuttle.html" title="class in org.apache.calcite.linq4j.tree">Shuttle</a> optimizer, |
| boolean performInline)</code></th> |
| <td class="colLast"> |
| <div class="block">Optimizes the list of statements.</div> |
| </td> |
| </tr> |
| <tr id="i22" class="altColor"> |
| <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> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.Object</h3> |
| <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a id="statements"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>statements</h4> |
| <pre>final java.util.List<<a href="Statement.html" title="class in org.apache.calcite.linq4j.tree">Statement</a>> statements</pre> |
| </li> |
| </ul> |
| <a id="variables"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>variables</h4> |
| <pre>final java.util.Set<java.lang.String> variables</pre> |
| </li> |
| </ul> |
| <a id="expressionForReuse"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>expressionForReuse</h4> |
| <pre>final java.util.Map<<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a>,​<a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a>> expressionForReuse</pre> |
| <div class="block">Contains final-fine-to-reuse-declarations. |
| An entry to this map is added when adding final declaration of a |
| statement with optimize=true parameter.</div> |
| </li> |
| </ul> |
| <a id="optimizing"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>optimizing</h4> |
| <pre>private final boolean optimizing</pre> |
| </li> |
| </ul> |
| <a id="parent"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parent</h4> |
| <pre>private final <a href="BlockBuilder.html" title="class in org.apache.calcite.linq4j.tree">BlockBuilder</a> parent</pre> |
| </li> |
| </ul> |
| <a id="OPTIMIZE_SHUTTLE"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>OPTIMIZE_SHUTTLE</h4> |
| <pre>private static final <a href="Shuttle.html" title="class in org.apache.calcite.linq4j.tree">Shuttle</a> OPTIMIZE_SHUTTLE</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a id="<init>()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>BlockBuilder</h4> |
| <pre>public BlockBuilder()</pre> |
| <div class="block">Creates a non-optimizing BlockBuilder.</div> |
| </li> |
| </ul> |
| <a id="<init>(boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>BlockBuilder</h4> |
| <pre>public BlockBuilder​(boolean optimizing)</pre> |
| <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> |
| </li> |
| </ul> |
| <a id="<init>(boolean,org.apache.calcite.linq4j.tree.BlockBuilder)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>BlockBuilder</h4> |
| <pre>public BlockBuilder​(boolean optimizing, |
| <a href="BlockBuilder.html" title="class in org.apache.calcite.linq4j.tree">BlockBuilder</a> parent)</pre> |
| <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> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="clear()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>clear</h4> |
| <pre class="methodSignature">public void clear()</pre> |
| <div class="block">Clears this BlockBuilder.</div> |
| </li> |
| </ul> |
| <a id="append(java.lang.String,org.apache.calcite.linq4j.tree.BlockStatement)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>append</h4> |
| <pre class="methodSignature">public <a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> append​(java.lang.String name, |
| <a href="BlockStatement.html" title="class in org.apache.calcite.linq4j.tree">BlockStatement</a> block)</pre> |
| <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> |
| </li> |
| </ul> |
| <a id="append(java.lang.String,org.apache.calcite.linq4j.tree.BlockStatement,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>append</h4> |
| <pre class="methodSignature">public <a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> append​(java.lang.String name, |
| <a href="BlockStatement.html" title="class in org.apache.calcite.linq4j.tree">BlockStatement</a> block, |
| boolean optimize)</pre> |
| <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> |
| </li> |
| </ul> |
| <a id="append(java.lang.String,org.apache.calcite.linq4j.tree.Expression)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>append</h4> |
| <pre class="methodSignature">public <a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> append​(java.lang.String name, |
| <a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> expression)</pre> |
| <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> |
| </li> |
| </ul> |
| <a id="appendIfNotNull(java.lang.String,org.apache.calcite.linq4j.tree.Expression)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>appendIfNotNull</h4> |
| <pre class="methodSignature">public <a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> appendIfNotNull​(java.lang.String name, |
| <a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> expression)</pre> |
| <div class="block">Appends an expression to a list of statements, if it is not null.</div> |
| </li> |
| </ul> |
| <a id="append(java.lang.String,org.apache.calcite.linq4j.tree.Expression,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>append</h4> |
| <pre class="methodSignature">public <a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> append​(java.lang.String name, |
| <a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> expression, |
| boolean optimize)</pre> |
| <div class="block">Appends an expression to a list of statements, optionally optimizing if |
| the expression is used more than once.</div> |
| </li> |
| </ul> |
| <a id="append_(java.lang.String,org.apache.calcite.linq4j.tree.Expression,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>append_</h4> |
| <pre class="methodSignature">private <a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> append_​(java.lang.String name, |
| <a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> expression, |
| boolean optimize)</pre> |
| </li> |
| </ul> |
| <a id="isSimpleExpression(org.apache.calcite.linq4j.tree.Expression)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isSimpleExpression</h4> |
| <pre class="methodSignature">protected boolean isSimpleExpression​(<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> expr)</pre> |
| <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> |
| </li> |
| </ul> |
| <a id="isSafeForReuse(org.apache.calcite.linq4j.tree.DeclarationStatement)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isSafeForReuse</h4> |
| <pre class="methodSignature">protected boolean isSafeForReuse​(<a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a> decl)</pre> |
| </li> |
| </ul> |
| <a id="addExpressionForReuse(org.apache.calcite.linq4j.tree.DeclarationStatement)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>addExpressionForReuse</h4> |
| <pre class="methodSignature">protected void addExpressionForReuse​(<a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a> decl)</pre> |
| </li> |
| </ul> |
| <a id="isCostly(org.apache.calcite.linq4j.tree.DeclarationStatement)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isCostly</h4> |
| <pre class="methodSignature">private boolean isCostly​(<a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a> decl)</pre> |
| </li> |
| </ul> |
| <a id="normalizeDeclaration(org.apache.calcite.linq4j.tree.DeclarationStatement)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>normalizeDeclaration</h4> |
| <pre class="methodSignature">private <a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> normalizeDeclaration​(<a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a> decl)</pre> |
| <div class="block">Prepares declaration for inlining: adds cast</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>decl</code> - inlining candidate</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>normalized expression</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getComputedExpression(org.apache.calcite.linq4j.tree.Expression)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getComputedExpression</h4> |
| <pre class="methodSignature">public <a href="DeclarationStatement.html" title="class in org.apache.calcite.linq4j.tree">DeclarationStatement</a> getComputedExpression​(<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> expr)</pre> |
| <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> |
| </li> |
| </ul> |
| <a id="add(org.apache.calcite.linq4j.tree.Statement)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>add</h4> |
| <pre class="methodSignature">public void add​(<a href="Statement.html" title="class in org.apache.calcite.linq4j.tree">Statement</a> statement)</pre> |
| </li> |
| </ul> |
| <a id="add(org.apache.calcite.linq4j.tree.Expression)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>add</h4> |
| <pre class="methodSignature">public void add​(<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> expression)</pre> |
| </li> |
| </ul> |
| <a id="toBlock()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toBlock</h4> |
| <pre class="methodSignature">public <a href="BlockStatement.html" title="class in org.apache.calcite.linq4j.tree">BlockStatement</a> toBlock()</pre> |
| <div class="block">Returns a block consisting of the current list of statements.</div> |
| </li> |
| </ul> |
| <a id="optimize(org.apache.calcite.linq4j.tree.Shuttle,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>optimize</h4> |
| <pre class="methodSignature">private boolean optimize​(<a href="Shuttle.html" title="class in org.apache.calcite.linq4j.tree">Shuttle</a> optimizer, |
| boolean performInline)</pre> |
| <div class="block">Optimizes the list of statements. If an expression is used only once, |
| it is inlined.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>whether any optimizations were made</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="createOptimizeShuttle()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>createOptimizeShuttle</h4> |
| <pre class="methodSignature">protected <a href="Shuttle.html" title="class in org.apache.calcite.linq4j.tree">Shuttle</a> createOptimizeShuttle()</pre> |
| <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> |
| </li> |
| </ul> |
| <a id="createFinishingOptimizeShuttle()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>createFinishingOptimizeShuttle</h4> |
| <pre class="methodSignature">protected <a href="Shuttle.html" title="class in org.apache.calcite.linq4j.tree">Shuttle</a> createFinishingOptimizeShuttle()</pre> |
| <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> |
| </li> |
| </ul> |
| <a id="newName(java.lang.String,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>newName</h4> |
| <pre class="methodSignature">private java.lang.String newName​(java.lang.String suggestion, |
| boolean optimize)</pre> |
| <div class="block">Creates a name for a new variable, unique within this block, controlling |
| whether the variable can be inlined later.</div> |
| </li> |
| </ul> |
| <a id="newName(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>newName</h4> |
| <pre class="methodSignature">public java.lang.String newName​(java.lang.String suggestion)</pre> |
| <div class="block">Creates a name for a new variable, unique within this block.</div> |
| </li> |
| </ul> |
| <a id="hasVariable(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hasVariable</h4> |
| <pre class="methodSignature">public boolean hasVariable​(java.lang.String name)</pre> |
| </li> |
| </ul> |
| <a id="append(org.apache.calcite.linq4j.tree.Expression)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>append</h4> |
| <pre class="methodSignature">public <a href="BlockBuilder.html" title="class in org.apache.calcite.linq4j.tree">BlockBuilder</a> append​(<a href="Expression.html" title="class in org.apache.calcite.linq4j.tree">Expression</a> expression)</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <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="class-use/BlockBuilder.html">Use</a></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> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2012–2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |