blob: 0fb540cc1599d45089a3b965e1bdb0b3bf0cef5d [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>RexLiteral (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="RexLiteral (Apache Calcite API)";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":9,"i3":9,"i4":10,"i5":10,"i6":10,"i7":9,"i8":9,"i9":9,"i10":9,"i11":10,"i12":9,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":9,"i23":10,"i24":10,"i25":10,"i26":9,"i27":9,"i28":10,"i29":9,"i30":9,"i31":9,"i32":9,"i33":9,"i34":9,"i35":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static 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/RexLiteral.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&nbsp;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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&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><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</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">&nbsp;</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>&nbsp;<a href="package-summary.html">org.apache.calcite.rex</a></div>
<h2 title="Class RexLiteral" class="title">Class RexLiteral</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="RexNode.html" title="class in org.apache.calcite.rex">org.apache.calcite.rex.RexNode</a></li>
<li>
<ul class="inheritance">
<li>org.apache.calcite.rex.RexLiteral</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre>public class <span class="typeNameLabel">RexLiteral</span>
extends <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></pre>
<div class="block">Constant value in a row-expression.
<p>There are several methods for creating literals in <a href="RexBuilder.html" title="class in org.apache.calcite.rex"><code>RexBuilder</code></a>:
<a href="RexBuilder.html#makeLiteral(boolean)"><code>RexBuilder.makeLiteral(boolean)</code></a> and so forth.</p>
<p>How is the value stored? In that respect, the class is somewhat of a black
box. There is a <a href="#getValue()"><code>getValue()</code></a> method which returns the value as an
object, but the type of that value is implementation detail, and it is best
that your code does not depend upon that knowledge. It is better to use
task-oriented methods such as <a href="#getValue2()"><code>getValue2()</code></a> and
<a href="#toJavaString(java.lang.Comparable,org.apache.calcite.sql.type.SqlTypeName,org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rex.RexDigestIncludeType)"><code>toJavaString(java.lang.Comparable, org.apache.calcite.sql.type.SqlTypeName, org.apache.calcite.rel.type.RelDataType, org.apache.calcite.rex.RexDigestIncludeType)</code></a>.</p>
<p>The allowable types and combinations are:</p>
<table>
<caption>Allowable types for RexLiteral instances</caption>
<tr>
<th>TypeName</th>
<th>Meaning</th>
<th>Value type</th>
</tr>
<tr>
<td><a href="../sql/type/SqlTypeName.html#NULL"><code>SqlTypeName.NULL</code></a></td>
<td>The null value. It has its own special type.</td>
<td>null</td>
</tr>
<tr>
<td><a href="../sql/type/SqlTypeName.html#BOOLEAN"><code>SqlTypeName.BOOLEAN</code></a></td>
<td>Boolean, namely <code>TRUE</code>, <code>FALSE</code> or <code>
UNKNOWN</code>.</td>
<td><code>Boolean</code>, or null represents the UNKNOWN value</td>
</tr>
<tr>
<td><a href="../sql/type/SqlTypeName.html#DECIMAL"><code>SqlTypeName.DECIMAL</code></a></td>
<td>Exact number, for example <code>0</code>, <code>-.5</code>, <code>
12345</code>.</td>
<td><code>BigDecimal</code></td>
</tr>
<tr>
<td><a href="../sql/type/SqlTypeName.html#DOUBLE"><code>SqlTypeName.DOUBLE</code></a></td>
<td>Approximate number, for example <code>6.023E-23</code>.</td>
<td><code>BigDecimal</code></td>
</tr>
<tr>
<td><a href="../sql/type/SqlTypeName.html#DATE"><code>SqlTypeName.DATE</code></a></td>
<td>Date, for example <code>DATE '1969-04'29'</code></td>
<td><code>Calendar</code>;
also <code>Calendar</code> (UTC time zone)
and <code>Integer</code> (days since POSIX epoch)</td>
</tr>
<tr>
<td><a href="../sql/type/SqlTypeName.html#TIME"><code>SqlTypeName.TIME</code></a></td>
<td>Time, for example <code>TIME '18:37:42.567'</code></td>
<td><code>Calendar</code>;
also <code>Calendar</code> (UTC time zone)
and <code>Integer</code> (milliseconds since midnight)</td>
</tr>
<tr>
<td><a href="../sql/type/SqlTypeName.html#TIMESTAMP"><code>SqlTypeName.TIMESTAMP</code></a></td>
<td>Timestamp, for example <code>TIMESTAMP '1969-04-29
18:37:42.567'</code></td>
<td><a href="../util/TimestampString.html" title="class in org.apache.calcite.util"><code>TimestampString</code></a>;
also <code>Calendar</code> (UTC time zone)
and <code>Long</code> (milliseconds since POSIX epoch)</td>
</tr>
<tr>
<td><a href="../sql/type/SqlTypeName.html#INTERVAL_DAY"><code>SqlTypeName.INTERVAL_DAY</code></a>,
<a href="../sql/type/SqlTypeName.html#INTERVAL_DAY_HOUR"><code>SqlTypeName.INTERVAL_DAY_HOUR</code></a>,
<a href="../sql/type/SqlTypeName.html#INTERVAL_DAY_MINUTE"><code>SqlTypeName.INTERVAL_DAY_MINUTE</code></a>,
<a href="../sql/type/SqlTypeName.html#INTERVAL_DAY_SECOND"><code>SqlTypeName.INTERVAL_DAY_SECOND</code></a>,
<a href="../sql/type/SqlTypeName.html#INTERVAL_HOUR"><code>SqlTypeName.INTERVAL_HOUR</code></a>,
<a href="../sql/type/SqlTypeName.html#INTERVAL_HOUR_MINUTE"><code>SqlTypeName.INTERVAL_HOUR_MINUTE</code></a>,
<a href="../sql/type/SqlTypeName.html#INTERVAL_HOUR_SECOND"><code>SqlTypeName.INTERVAL_HOUR_SECOND</code></a>,
<a href="../sql/type/SqlTypeName.html#INTERVAL_MINUTE"><code>SqlTypeName.INTERVAL_MINUTE</code></a>,
<a href="../sql/type/SqlTypeName.html#INTERVAL_MINUTE_SECOND"><code>SqlTypeName.INTERVAL_MINUTE_SECOND</code></a>,
<a href="../sql/type/SqlTypeName.html#INTERVAL_SECOND"><code>SqlTypeName.INTERVAL_SECOND</code></a></td>
<td>Interval, for example <code>INTERVAL '4:3:2' HOUR TO SECOND</code></td>
<td><code>BigDecimal</code>;
also <code>Long</code> (milliseconds)</td>
</tr>
<tr>
<td><a href="../sql/type/SqlTypeName.html#INTERVAL_YEAR"><code>SqlTypeName.INTERVAL_YEAR</code></a>,
<a href="../sql/type/SqlTypeName.html#INTERVAL_YEAR_MONTH"><code>SqlTypeName.INTERVAL_YEAR_MONTH</code></a>,
<a href="../sql/type/SqlTypeName.html#INTERVAL_MONTH"><code>SqlTypeName.INTERVAL_MONTH</code></a></td>
<td>Interval, for example <code>INTERVAL '2-3' YEAR TO MONTH</code></td>
<td><code>BigDecimal</code>;
also <code>Integer</code> (months)</td>
</tr>
<tr>
<td><a href="../sql/type/SqlTypeName.html#CHAR"><code>SqlTypeName.CHAR</code></a></td>
<td>Character constant, for example <code>'Hello, world!'</code>, <code>
''</code>, <code>_N'Bonjour'</code>, <code>_ISO-8859-1'It''s superman!'
COLLATE SHIFT_JIS$ja_JP$2</code>. These are always CHAR, never VARCHAR.</td>
<td><a href="../util/NlsString.html" title="class in org.apache.calcite.util"><code>NlsString</code></a>;
also <code>String</code></td>
</tr>
<tr>
<td><a href="../sql/type/SqlTypeName.html#BINARY"><code>SqlTypeName.BINARY</code></a></td>
<td>Binary constant, for example <code>X'7F34'</code>. (The number of hexits
must be even; see above.) These constants are always BINARY, never
VARBINARY.</td>
<td><code>ByteBuffer</code>;
also <code>byte[]</code></td>
</tr>
<tr>
<td><a href="../sql/type/SqlTypeName.html#SYMBOL"><code>SqlTypeName.SYMBOL</code></a></td>
<td>A symbol is a special type used to make parsing easier; it is not part of
the SQL standard, and is not exposed to end-users. It is used to hold a flag,
such as the LEADING flag in a call to the function <code>
TRIM([LEADING|TRAILING|BOTH] chars FROM string)</code>.</td>
<td>An enum class</td>
</tr>
</table></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== 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">&nbsp;</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>private static com.google.common.collect.ImmutableList&lt;org.apache.calcite.avatica.util.TimeUnit&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#TIME_UNITS">TIME_UNITS</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private <a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#type">type</a></span></code></th>
<td class="colLast">
<div class="block">The real type of this literal, as reported by <a href="#getType()"><code>getType()</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private <a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#typeName">typeName</a></span></code></th>
<td class="colLast">
<div class="block">An indication of the broad type of this literal -- even if its type isn't
a SQL type.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private java.lang.Comparable</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#value">value</a></span></code></th>
<td class="colLast">
<div class="block">The value of this literal.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="fields.inherited.from.class.org.apache.calcite.rex.RexNode">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.calcite.rex.<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></h3>
<code><a href="RexNode.html#digest">digest</a></code></li>
</ul>
</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">&nbsp;</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(java.lang.Comparable,org.apache.calcite.rel.type.RelDataType,org.apache.calcite.sql.type.SqlTypeName)">RexLiteral</a></span>&#8203;(java.lang.Comparable&nbsp;value,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;type,
<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a>&nbsp;typeName)</code></th>
<td class="colLast">
<div class="block">Creates a <code>RexLiteral</code>.</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">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</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>&lt;R,&#8203;P&gt;<br>R</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#accept(org.apache.calcite.rex.RexBiVisitor,P)">accept</a></span>&#8203;(<a href="RexBiVisitor.html" title="interface in org.apache.calcite.rex">RexBiVisitor</a>&lt;R,&#8203;P&gt;&nbsp;visitor,
P&nbsp;arg)</code></th>
<td class="colLast">
<div class="block">Accepts a visitor with a payload, dispatching to the right overloaded
<a href="RexBiVisitor.html#visitInputRef(org.apache.calcite.rex.RexInputRef,P)"><code>RexBiVisitor.visitInputRef(RexInputRef, Object)</code></a> visitXxx} method.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>&lt;R&gt;&nbsp;R</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#accept(org.apache.calcite.rex.RexVisitor)">accept</a></span>&#8203;(<a href="RexVisitor.html" title="interface in org.apache.calcite.rex">RexVisitor</a>&lt;R&gt;&nbsp;visitor)</code></th>
<td class="colLast">
<div class="block">Accepts a visitor, dispatching to the right overloaded
<a href="RexVisitor.html#visitInputRef(org.apache.calcite.rex.RexInputRef)"><code>visitXxx</code></a> method.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>private static void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#appendAsJava(java.lang.Comparable,java.lang.Appendable,org.apache.calcite.sql.type.SqlTypeName,boolean,org.apache.calcite.rex.RexDigestIncludeType)">appendAsJava</a></span>&#8203;(java.lang.Comparable&nbsp;value,
java.lang.Appendable&nbsp;destination,
<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a>&nbsp;typeName,
boolean&nbsp;java,
<a href="RexDigestIncludeType.html" title="enum in org.apache.calcite.rex">RexDigestIncludeType</a>&nbsp;includeType)</code></th>
<td class="colLast">
<div class="block">Appends the specified value in the provided destination as a Java string.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#booleanValue(org.apache.calcite.rex.RexNode)">booleanValue</a></span>&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;node)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#computeDigest(org.apache.calcite.rex.RexDigestIncludeType)">computeDigest</a></span>&#8203;(<a href="RexDigestIncludeType.html" title="enum in org.apache.calcite.rex">RexDigestIncludeType</a>&nbsp;includeType)</code></th>
<td class="colLast">
<div class="block">Returns a string which concisely describes the definition of this
rex literal.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>(package private) <a href="RexDigestIncludeType.html" title="enum in org.apache.calcite.rex">RexDigestIncludeType</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#digestIncludesType()">digestIncludesType</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns true if <a href="RexDigestIncludeType.html#OPTIONAL"><code>RexDigestIncludeType.OPTIONAL</code></a> digest would include data type.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#equals(java.lang.Object)">equals</a></span>&#8203;(java.lang.Object&nbsp;obj)</code></th>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>private static boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#equals(java.lang.Object,java.lang.Object)">equals</a></span>&#8203;(java.lang.Object&nbsp;o1,
java.lang.Object&nbsp;o2)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>private static java.lang.Comparable</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#findValue(org.apache.calcite.rex.RexNode)">findValue</a></span>&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;node)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>static <a href="RexLiteral.html" title="class in org.apache.calcite.rex">RexLiteral</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#fromJdbcString(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.sql.type.SqlTypeName,java.lang.String)">fromJdbcString</a></span>&#8203;(<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;type,
<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a>&nbsp;typeName,
java.lang.String&nbsp;literal)</code></th>
<td class="colLast">
<div class="block">Converts a Jdbc string into a RexLiteral.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>private static java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getCalendarFormat(org.apache.calcite.sql.type.SqlTypeName)">getCalendarFormat</a></span>&#8203;(<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a>&nbsp;typeName)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="../sql/SqlKind.html" title="enum in org.apache.calcite.sql">SqlKind</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getKind()">getKind</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the kind of node this is.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>private static java.util.List&lt;org.apache.calcite.avatica.util.TimeUnit&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getTimeUnits(org.apache.calcite.sql.type.SqlTypeName)">getTimeUnits</a></span>&#8203;(<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a>&nbsp;typeName)</code></th>
<td class="colLast">
<div class="block">Returns a list of the time units covered by an interval type such
as HOUR TO SECOND.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code><a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getType()">getType</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code><a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getTypeName()">getTypeName</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>java.lang.Comparable</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getValue()">getValue</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the value of this literal.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>java.lang.Object</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getValue2()">getValue2</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the value of this literal, in the form that the calculator
program builder wants it.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>java.lang.Object</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getValue3()">getValue3</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the value of this literal, in the form that the rex-to-lix
translator wants it.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>java.lang.Comparable</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getValue4()">getValue4</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the value of this literal, in the form that <a href="RexInterpreter.html" title="class in org.apache.calcite.rex"><code>RexInterpreter</code></a>
wants it.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getValueAs(java.lang.Class)">getValueAs</a></span>&#8203;(java.lang.Class&lt;T&gt;&nbsp;clazz)</code></th>
<td class="colLast">
<div class="block">Returns the value of this literal as an instance of the specified class.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hashCode()">hashCode</a></span>()</code></th>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>private java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#intervalString(java.math.BigDecimal)">intervalString</a></span>&#8203;(java.math.BigDecimal&nbsp;v)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#intValue(org.apache.calcite.rex.RexNode)">intValue</a></span>&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;node)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isAlwaysFalse()">isAlwaysFalse</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns whether this expression always returns false.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isAlwaysTrue()">isAlwaysTrue</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns whether this expression always returns true.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isNull()">isNull</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns whether this literal's value is null.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isNullLiteral(org.apache.calcite.rex.RexNode)">isNullLiteral</a></span>&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;node)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code>private static void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#pad(java.lang.StringBuilder,java.lang.String,int)">pad</a></span>&#8203;(java.lang.StringBuilder&nbsp;b,
java.lang.String&nbsp;s,
int&nbsp;width)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i28" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#printAsJava(java.io.PrintWriter)">printAsJava</a></span>&#8203;(java.io.PrintWriter&nbsp;pw)</code></th>
<td class="colLast">
<div class="block">Prints the value this literal as a Java string constant.</div>
</td>
</tr>
<tr id="i29" class="rowColor">
<td class="colFirst"><code>private static <a href="RexDigestIncludeType.html" title="enum in org.apache.calcite.rex">RexDigestIncludeType</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#shouldIncludeType(java.lang.Comparable,org.apache.calcite.rel.type.RelDataType)">shouldIncludeType</a></span>&#8203;(java.lang.Comparable&nbsp;value,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;type)</code></th>
<td class="colLast">
<div class="block">Computes if data type can be omitted from the digset.</div>
</td>
</tr>
<tr id="i30" class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#stringValue(org.apache.calcite.rex.RexNode)">stringValue</a></span>&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;node)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i31" class="rowColor">
<td class="colFirst"><code>private static java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toJavaString(java.lang.Comparable,org.apache.calcite.sql.type.SqlTypeName,org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rex.RexDigestIncludeType)">toJavaString</a></span>&#8203;(java.lang.Comparable&nbsp;value,
<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a>&nbsp;typeName,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;type,
<a href="RexDigestIncludeType.html" title="enum in org.apache.calcite.rex">RexDigestIncludeType</a>&nbsp;includeType)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i32" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#validConstant(java.lang.Object,org.apache.calcite.util.Litmus)">validConstant</a></span>&#8203;(java.lang.Object&nbsp;o,
<a href="../util/Litmus.html" title="interface in org.apache.calcite.util">Litmus</a>&nbsp;litmus)</code></th>
<td class="colLast">
<div class="block">Returns whether a value is valid as a constant value, using the same
criteria as <a href="#valueMatchesType(java.lang.Comparable,org.apache.calcite.sql.type.SqlTypeName,boolean)"><code>valueMatchesType(java.lang.Comparable, org.apache.calcite.sql.type.SqlTypeName, boolean)</code></a>.</div>
</td>
</tr>
<tr id="i33" class="rowColor">
<td class="colFirst"><code>static java.lang.Comparable</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#value(org.apache.calcite.rex.RexNode)">value</a></span>&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;node)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i34" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#valueMatchesType(java.lang.Comparable,org.apache.calcite.sql.type.SqlTypeName,boolean)">valueMatchesType</a></span>&#8203;(java.lang.Comparable&nbsp;value,
<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a>&nbsp;typeName,
boolean&nbsp;strict)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i35" class="rowColor">
<td class="colFirst"><code>private static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#width(org.apache.calcite.avatica.util.TimeUnit)">width</a></span>&#8203;(org.apache.calcite.avatica.util.TimeUnit&nbsp;timeUnit)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.org.apache.calcite.rex.RexNode">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.calcite.rex.<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></h3>
<code><a href="RexNode.html#isA(java.util.Collection)">isA</a>, <a href="RexNode.html#isA(org.apache.calcite.sql.SqlKind)">isA</a>, <a href="RexNode.html#toString()">toString</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, finalize, getClass, notify, notifyAll, 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="value">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>value</h4>
<pre>private final&nbsp;java.lang.Comparable value</pre>
<div class="block">The value of this literal. Must be consistent with its type, as per
<a href="#valueMatchesType(java.lang.Comparable,org.apache.calcite.sql.type.SqlTypeName,boolean)"><code>valueMatchesType(java.lang.Comparable, org.apache.calcite.sql.type.SqlTypeName, boolean)</code></a>. For example, you can't store an
<code>Integer</code> value here just because you feel like it -- all numbers are
represented by a <code>BigDecimal</code>. But since this field is private, it
doesn't really matter how the values are stored.</div>
</li>
</ul>
<a id="type">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>type</h4>
<pre>private final&nbsp;<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type</pre>
<div class="block">The real type of this literal, as reported by <a href="#getType()"><code>getType()</code></a>.</div>
</li>
</ul>
<a id="typeName">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>typeName</h4>
<pre>private final&nbsp;<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a> typeName</pre>
<div class="block">An indication of the broad type of this literal -- even if its type isn't
a SQL type. Sometimes this will be different than the SQL type; for
example, all exact numbers, including integers have typeName
<a href="../sql/type/SqlTypeName.html#DECIMAL"><code>SqlTypeName.DECIMAL</code></a>. See <a href="#valueMatchesType(java.lang.Comparable,org.apache.calcite.sql.type.SqlTypeName,boolean)"><code>valueMatchesType(java.lang.Comparable, org.apache.calcite.sql.type.SqlTypeName, boolean)</code></a> for the
definitive story.</div>
</li>
</ul>
<a id="TIME_UNITS">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>TIME_UNITS</h4>
<pre>private static final&nbsp;com.google.common.collect.ImmutableList&lt;org.apache.calcite.avatica.util.TimeUnit&gt; TIME_UNITS</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="&lt;init&gt;(java.lang.Comparable,org.apache.calcite.rel.type.RelDataType,org.apache.calcite.sql.type.SqlTypeName)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>RexLiteral</h4>
<pre>RexLiteral&#8203;(java.lang.Comparable&nbsp;value,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;type,
<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a>&nbsp;typeName)</pre>
<div class="block">Creates a <code>RexLiteral</code>.</div>
</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="computeDigest(org.apache.calcite.rex.RexDigestIncludeType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>computeDigest</h4>
<pre class="methodSignature">public final&nbsp;java.lang.String&nbsp;computeDigest&#8203;(<a href="RexDigestIncludeType.html" title="enum in org.apache.calcite.rex">RexDigestIncludeType</a>&nbsp;includeType)</pre>
<div class="block">Returns a string which concisely describes the definition of this
rex literal. Two literals are equivalent if and only if their digests are the same.
<p>The digest does not contain the expression's identity, but does include the identity
of children.
<p>Technically speaking 1:INT differs from 1:FLOAT, so we need data type in the literal's
digest, however we want to avoid extra verbosity of the <a href="../plan/RelOptNode.html#getDigest()"><code>RelOptNode.getDigest()</code></a> for
readability purposes, so we omit type info in certain cases.
For instance, 1:INT becomes 1 (INT is implied by default), however 1:BIGINT always holds
the type
<p>Here's a non-exhaustive list of the "well known cases":
<ul><li>Hide "NOT NULL" for not null literals
<li>Hide INTEGER, BOOLEAN, SYMBOL, TIME(0), TIMESTAMP(0), DATE(0) types
<li>Hide collation when it matches IMPLICIT/COERCIBLE
<li>Hide charset when it matches default
<li>Hide CHAR(xx) when literal length is equal to the precision of the type.
In other words, use 'Bob' instead of 'Bob':CHAR(3)
<li>Hide BOOL for AND/OR arguments. In other words, AND(true, null) means
null is BOOL.
<li>Hide types for literals in simple binary operations (e.g. +, -, *, /,
comparison) when type of the other argument is clear.
See <a href="RexCall.html#computeDigest(boolean)"><code>RexCall.computeDigest(boolean)</code></a>
For instance: =(true. null) means null is BOOL. =($0, null) means the type
of null matches the type of $0.
</ul></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>includeType</code> - whether the digest should include type or not</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>digest</dd>
</dl>
</li>
</ul>
<a id="digestIncludesType()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>digestIncludesType</h4>
<pre class="methodSignature"><a href="RexDigestIncludeType.html" title="enum in org.apache.calcite.rex">RexDigestIncludeType</a>&nbsp;digestIncludesType()</pre>
<div class="block">Returns true if <a href="RexDigestIncludeType.html#OPTIONAL"><code>RexDigestIncludeType.OPTIONAL</code></a> digest would include data type.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if <a href="RexDigestIncludeType.html#OPTIONAL"><code>RexDigestIncludeType.OPTIONAL</code></a> digest would include data type</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="RexCall.html#computeDigest(boolean)"><code>RexCall.computeDigest(boolean)</code></a></dd>
</dl>
</li>
</ul>
<a id="valueMatchesType(java.lang.Comparable,org.apache.calcite.sql.type.SqlTypeName,boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>valueMatchesType</h4>
<pre class="methodSignature">public static&nbsp;boolean&nbsp;valueMatchesType&#8203;(java.lang.Comparable&nbsp;value,
<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a>&nbsp;typeName,
boolean&nbsp;strict)</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>whether value is appropriate for its type (we have rules about
these things)</dd>
</dl>
</li>
</ul>
<a id="toJavaString(java.lang.Comparable,org.apache.calcite.sql.type.SqlTypeName,org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rex.RexDigestIncludeType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toJavaString</h4>
<pre class="methodSignature">private static&nbsp;java.lang.String&nbsp;toJavaString&#8203;(java.lang.Comparable&nbsp;value,
<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a>&nbsp;typeName,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;type,
<a href="RexDigestIncludeType.html" title="enum in org.apache.calcite.rex">RexDigestIncludeType</a>&nbsp;includeType)</pre>
</li>
</ul>
<a id="shouldIncludeType(java.lang.Comparable,org.apache.calcite.rel.type.RelDataType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>shouldIncludeType</h4>
<pre class="methodSignature">private static&nbsp;<a href="RexDigestIncludeType.html" title="enum in org.apache.calcite.rex">RexDigestIncludeType</a>&nbsp;shouldIncludeType&#8203;(java.lang.Comparable&nbsp;value,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;type)</pre>
<div class="block">Computes if data type can be omitted from the digset.
<p>For instance, <code>1:BIGINT</code> has to keep data type while <code>1:INT</code>
should be represented as just <code>1</code>.
<p>Implementation assumption: this method should be fast. In fact might call
<a href="../util/NlsString.html#getValue()"><code>NlsString.getValue()</code></a> which could decode the string, however we rely on the cache there.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - value of the literal</dd>
<dd><code>type</code> - type of the literal</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>NO_TYPE when type can be omitted, ALWAYS otherwise</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#computeDigest(org.apache.calcite.rex.RexDigestIncludeType)"><code>computeDigest(RexDigestIncludeType)</code></a></dd>
</dl>
</li>
</ul>
<a id="validConstant(java.lang.Object,org.apache.calcite.util.Litmus)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>validConstant</h4>
<pre class="methodSignature">public static&nbsp;boolean&nbsp;validConstant&#8203;(java.lang.Object&nbsp;o,
<a href="../util/Litmus.html" title="interface in org.apache.calcite.util">Litmus</a>&nbsp;litmus)</pre>
<div class="block">Returns whether a value is valid as a constant value, using the same
criteria as <a href="#valueMatchesType(java.lang.Comparable,org.apache.calcite.sql.type.SqlTypeName,boolean)"><code>valueMatchesType(java.lang.Comparable, org.apache.calcite.sql.type.SqlTypeName, boolean)</code></a>.</div>
</li>
</ul>
<a id="getTimeUnits(org.apache.calcite.sql.type.SqlTypeName)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTimeUnits</h4>
<pre class="methodSignature">private static&nbsp;java.util.List&lt;org.apache.calcite.avatica.util.TimeUnit&gt;&nbsp;getTimeUnits&#8203;(<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a>&nbsp;typeName)</pre>
<div class="block">Returns a list of the time units covered by an interval type such
as HOUR TO SECOND. Adds MILLISECOND if the end is SECOND, to deal with
fractional seconds.</div>
</li>
</ul>
<a id="intervalString(java.math.BigDecimal)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>intervalString</h4>
<pre class="methodSignature">private&nbsp;java.lang.String&nbsp;intervalString&#8203;(java.math.BigDecimal&nbsp;v)</pre>
</li>
</ul>
<a id="pad(java.lang.StringBuilder,java.lang.String,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>pad</h4>
<pre class="methodSignature">private static&nbsp;void&nbsp;pad&#8203;(java.lang.StringBuilder&nbsp;b,
java.lang.String&nbsp;s,
int&nbsp;width)</pre>
</li>
</ul>
<a id="width(org.apache.calcite.avatica.util.TimeUnit)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>width</h4>
<pre class="methodSignature">private static&nbsp;int&nbsp;width&#8203;(org.apache.calcite.avatica.util.TimeUnit&nbsp;timeUnit)</pre>
</li>
</ul>
<a id="printAsJava(java.io.PrintWriter)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>printAsJava</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;printAsJava&#8203;(java.io.PrintWriter&nbsp;pw)</pre>
<div class="block">Prints the value this literal as a Java string constant.</div>
</li>
</ul>
<a id="appendAsJava(java.lang.Comparable,java.lang.Appendable,org.apache.calcite.sql.type.SqlTypeName,boolean,org.apache.calcite.rex.RexDigestIncludeType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>appendAsJava</h4>
<pre class="methodSignature">private static&nbsp;void&nbsp;appendAsJava&#8203;(java.lang.Comparable&nbsp;value,
java.lang.Appendable&nbsp;destination,
<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a>&nbsp;typeName,
boolean&nbsp;java,
<a href="RexDigestIncludeType.html" title="enum in org.apache.calcite.rex">RexDigestIncludeType</a>&nbsp;includeType)</pre>
<div class="block">Appends the specified value in the provided destination as a Java string. The value must be
consistent with the type, as per <a href="#valueMatchesType(java.lang.Comparable,org.apache.calcite.sql.type.SqlTypeName,boolean)"><code>valueMatchesType(java.lang.Comparable, org.apache.calcite.sql.type.SqlTypeName, boolean)</code></a>.
<p>Typical return values:</p>
<ul>
<li>true</li>
<li>null</li>
<li>"Hello, world!"</li>
<li>1.25</li>
<li>1234ABCD</li>
</ul>
<p>The destination where the value is appended must not incur I/O operations. This method is
not meant to be used for writing the values to permanent storage.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - a value to be appended to the provided destination as a Java string</dd>
<dd><code>destination</code> - a destination where to append the specified value</dd>
<dd><code>typeName</code> - a type name to be used for the transformation of the value to a Java string</dd>
<dd><code>includeType</code> - an indicator whether to include the data type in the Java representation</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if the appending to the destination <code>Appendable</code> fails
due to I/O</dd>
</dl>
</li>
</ul>
<a id="fromJdbcString(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.sql.type.SqlTypeName,java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fromJdbcString</h4>
<pre class="methodSignature">public static&nbsp;<a href="RexLiteral.html" title="class in org.apache.calcite.rex">RexLiteral</a>&nbsp;fromJdbcString&#8203;(<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;type,
<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a>&nbsp;typeName,
java.lang.String&nbsp;literal)</pre>
<div class="block">Converts a Jdbc string into a RexLiteral. This method accepts a string,
as returned by the Jdbc method ResultSet.getString(), and restores the
string into an equivalent RexLiteral. It allows one to use Jdbc strings
as a common format for data.
<p>If a null literal is provided, then a null pointer will be returned.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>type</code> - data type of literal to be read</dd>
<dd><code>typeName</code> - type family of literal</dd>
<dd><code>literal</code> - the (non-SQL encoded) string representation, as returned
by the Jdbc call to return a column as a string</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a typed RexLiteral, or null</dd>
</dl>
</li>
</ul>
<a id="getCalendarFormat(org.apache.calcite.sql.type.SqlTypeName)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCalendarFormat</h4>
<pre class="methodSignature">private static&nbsp;java.lang.String&nbsp;getCalendarFormat&#8203;(<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a>&nbsp;typeName)</pre>
</li>
</ul>
<a id="getTypeName()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTypeName</h4>
<pre class="methodSignature">public&nbsp;<a href="../sql/type/SqlTypeName.html" title="enum in org.apache.calcite.sql.type">SqlTypeName</a>&nbsp;getTypeName()</pre>
</li>
</ul>
<a id="getType()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getType</h4>
<pre class="methodSignature">public&nbsp;<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;getType()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="RexNode.html#getType()">getType</a></code>&nbsp;in class&nbsp;<code><a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></dd>
</dl>
</li>
</ul>
<a id="getKind()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getKind</h4>
<pre class="methodSignature">public&nbsp;<a href="../sql/SqlKind.html" title="enum in org.apache.calcite.sql">SqlKind</a>&nbsp;getKind()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="RexNode.html#getKind()">RexNode</a></code></span></div>
<div class="block">Returns the kind of node this is.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="RexNode.html#getKind()">getKind</a></code>&nbsp;in class&nbsp;<code><a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Node kind, never null</dd>
</dl>
</li>
</ul>
<a id="isNull()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isNull</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;isNull()</pre>
<div class="block">Returns whether this literal's value is null.</div>
</li>
</ul>
<a id="getValue()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValue</h4>
<pre class="methodSignature">public&nbsp;java.lang.Comparable&nbsp;getValue()</pre>
<div class="block">Returns the value of this literal.
<p>For backwards compatibility, returns DATE. TIME and TIMESTAMP as a
<code>Calendar</code> value in UTC time zone.</div>
</li>
</ul>
<a id="getValue2()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValue2</h4>
<pre class="methodSignature">public&nbsp;java.lang.Object&nbsp;getValue2()</pre>
<div class="block">Returns the value of this literal, in the form that the calculator
program builder wants it.</div>
</li>
</ul>
<a id="getValue3()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValue3</h4>
<pre class="methodSignature">public&nbsp;java.lang.Object&nbsp;getValue3()</pre>
<div class="block">Returns the value of this literal, in the form that the rex-to-lix
translator wants it.</div>
</li>
</ul>
<a id="getValue4()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValue4</h4>
<pre class="methodSignature">public&nbsp;java.lang.Comparable&nbsp;getValue4()</pre>
<div class="block">Returns the value of this literal, in the form that <a href="RexInterpreter.html" title="class in org.apache.calcite.rex"><code>RexInterpreter</code></a>
wants it.</div>
</li>
</ul>
<a id="getValueAs(java.lang.Class)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValueAs</h4>
<pre class="methodSignature">public&nbsp;&lt;T&gt;&nbsp;T&nbsp;getValueAs&#8203;(java.lang.Class&lt;T&gt;&nbsp;clazz)</pre>
<div class="block">Returns the value of this literal as an instance of the specified class.
<p>The following SQL types allow more than one form:
<ul>
<li>CHAR as <a href="../util/NlsString.html" title="class in org.apache.calcite.util"><code>NlsString</code></a> or <code>String</code>
<li>TIME as <a href="../util/TimeString.html" title="class in org.apache.calcite.util"><code>TimeString</code></a>,
<code>Integer</code> (milliseconds since midnight),
<code>Calendar</code> (in UTC)
<li>DATE as <a href="../util/DateString.html" title="class in org.apache.calcite.util"><code>DateString</code></a>,
<code>Integer</code> (days since 1970-01-01),
<code>Calendar</code>
<li>TIMESTAMP as <a href="../util/TimestampString.html" title="class in org.apache.calcite.util"><code>TimestampString</code></a>,
<code>Long</code> (milliseconds since 1970-01-01 00:00:00),
<code>Calendar</code>
<li>DECIMAL as <code>BigDecimal</code> or <code>Long</code>
</ul>
<p>Called with <code>clazz</code> = <code>Comparable</code>, returns the value in
its native form.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - Return type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>clazz</code> - Desired return type</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Value of this literal in the desired type</dd>
</dl>
</li>
</ul>
<a id="booleanValue(org.apache.calcite.rex.RexNode)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>booleanValue</h4>
<pre class="methodSignature">public static&nbsp;boolean&nbsp;booleanValue&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;node)</pre>
</li>
</ul>
<a id="isAlwaysTrue()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAlwaysTrue</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;isAlwaysTrue()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="RexNode.html#isAlwaysTrue()">RexNode</a></code></span></div>
<div class="block">Returns whether this expression always returns true. (Such as if this
expression is equal to the literal <code>TRUE</code>.)</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="RexNode.html#isAlwaysTrue()">isAlwaysTrue</a></code>&nbsp;in class&nbsp;<code><a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></dd>
</dl>
</li>
</ul>
<a id="isAlwaysFalse()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAlwaysFalse</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;isAlwaysFalse()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="RexNode.html#isAlwaysFalse()">RexNode</a></code></span></div>
<div class="block">Returns whether this expression always returns false. (Such as if this
expression is equal to the literal <code>FALSE</code>.)</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="RexNode.html#isAlwaysFalse()">isAlwaysFalse</a></code>&nbsp;in class&nbsp;<code><a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></dd>
</dl>
</li>
</ul>
<a id="equals(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;equals&#8203;(java.lang.Object&nbsp;obj)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="RexNode.html#equals(java.lang.Object)">RexNode</a></code></span></div>
<div class="block">
<p>Every node must implement <a href="RexNode.html#equals(java.lang.Object)"><code>RexNode.equals(java.lang.Object)</code></a> based on its content</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="RexNode.html#equals(java.lang.Object)">equals</a></code>&nbsp;in class&nbsp;<code><a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></dd>
</dl>
</li>
</ul>
<a id="hashCode()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;hashCode()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="RexNode.html#hashCode()">RexNode</a></code></span></div>
<div class="block">
<p>Every node must implement <a href="RexNode.html#hashCode()"><code>RexNode.hashCode()</code></a> consistent with
<a href="RexNode.html#equals(java.lang.Object)"><code>RexNode.equals(java.lang.Object)</code></a></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="RexNode.html#hashCode()">hashCode</a></code>&nbsp;in class&nbsp;<code><a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></dd>
</dl>
</li>
</ul>
<a id="value(org.apache.calcite.rex.RexNode)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>value</h4>
<pre class="methodSignature">public static&nbsp;java.lang.Comparable&nbsp;value&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;node)</pre>
</li>
</ul>
<a id="intValue(org.apache.calcite.rex.RexNode)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>intValue</h4>
<pre class="methodSignature">public static&nbsp;int&nbsp;intValue&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;node)</pre>
</li>
</ul>
<a id="stringValue(org.apache.calcite.rex.RexNode)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>stringValue</h4>
<pre class="methodSignature">public static&nbsp;java.lang.String&nbsp;stringValue&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;node)</pre>
</li>
</ul>
<a id="findValue(org.apache.calcite.rex.RexNode)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>findValue</h4>
<pre class="methodSignature">private static&nbsp;java.lang.Comparable&nbsp;findValue&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;node)</pre>
</li>
</ul>
<a id="isNullLiteral(org.apache.calcite.rex.RexNode)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isNullLiteral</h4>
<pre class="methodSignature">public static&nbsp;boolean&nbsp;isNullLiteral&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;node)</pre>
</li>
</ul>
<a id="equals(java.lang.Object,java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre class="methodSignature">private static&nbsp;boolean&nbsp;equals&#8203;(java.lang.Object&nbsp;o1,
java.lang.Object&nbsp;o2)</pre>
</li>
</ul>
<a id="accept(org.apache.calcite.rex.RexVisitor)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>accept</h4>
<pre class="methodSignature">public&nbsp;&lt;R&gt;&nbsp;R&nbsp;accept&#8203;(<a href="RexVisitor.html" title="interface in org.apache.calcite.rex">RexVisitor</a>&lt;R&gt;&nbsp;visitor)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="RexNode.html#accept(org.apache.calcite.rex.RexVisitor)">RexNode</a></code></span></div>
<div class="block">Accepts a visitor, dispatching to the right overloaded
<a href="RexVisitor.html#visitInputRef(org.apache.calcite.rex.RexInputRef)"><code>visitXxx</code></a> method.
<p>Also see <a href="RexUtil.html#apply(org.apache.calcite.rex.RexVisitor,java.util.List,org.apache.calcite.rex.RexNode)"><code>RexUtil.apply(RexVisitor, java.util.List, RexNode)</code></a>,
which applies a visitor to several expressions simultaneously.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="RexNode.html#accept(org.apache.calcite.rex.RexVisitor)">accept</a></code>&nbsp;in class&nbsp;<code><a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></dd>
</dl>
</li>
</ul>
<a id="accept(org.apache.calcite.rex.RexBiVisitor,java.lang.Object)">
<!-- -->
</a><a id="accept(org.apache.calcite.rex.RexBiVisitor,P)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>accept</h4>
<pre class="methodSignature">public&nbsp;&lt;R,&#8203;P&gt;&nbsp;R&nbsp;accept&#8203;(<a href="RexBiVisitor.html" title="interface in org.apache.calcite.rex">RexBiVisitor</a>&lt;R,&#8203;P&gt;&nbsp;visitor,
P&nbsp;arg)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="RexNode.html#accept(org.apache.calcite.rex.RexBiVisitor,P)">RexNode</a></code></span></div>
<div class="block">Accepts a visitor with a payload, dispatching to the right overloaded
<a href="RexBiVisitor.html#visitInputRef(org.apache.calcite.rex.RexInputRef,P)"><code>RexBiVisitor.visitInputRef(RexInputRef, Object)</code></a> visitXxx} method.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="RexNode.html#accept(org.apache.calcite.rex.RexBiVisitor,P)">accept</a></code>&nbsp;in class&nbsp;<code><a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></dd>
</dl>
</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/RexLiteral.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&nbsp;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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&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><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</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 &#169; 2012&#x2013;2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</body>
</html>