Package org.apache.calcite.rex
Class RexLocalRef
- java.lang.Object
-
- org.apache.calcite.rex.RexNode
-
- org.apache.calcite.rex.RexVariable
-
- org.apache.calcite.rex.RexSlot
-
- org.apache.calcite.rex.RexLocalRef
-
public class RexLocalRef extends RexSlot
Local variable.Identity is based upon type and index. We want multiple references to the same slot in the same context to be equal. A side effect is that references to slots in different contexts which happen to have the same index and type will be considered equal; this is not desired, but not too damaging, because of the immutability.
Variables are immutable.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.calcite.rex.RexSlot
RexSlot.SelfPopulatingList
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.List<java.lang.String>
NAMES
-
Fields inherited from class org.apache.calcite.rex.RexVariable
name, type
-
-
Constructor Summary
Constructors Constructor Description RexLocalRef(int index, RelDataType type)
Creates a local variable.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,P>
Raccept(RexBiVisitor<R,P> visitor, P arg)
Accepts a visitor with a payload, dispatching to the right overloadedRexBiVisitor.visitInputRef(RexInputRef, Object)
visitXxx} method.<R> R
accept(RexVisitor<R> visitor)
Accepts a visitor, dispatching to the right overloadedvisitXxx
method.private static java.lang.String
createName(int index)
boolean
equals(java.lang.Object obj)
SqlKind
getKind()
Returns the kind of node this is.int
hashCode()
-
Methods inherited from class org.apache.calcite.rex.RexVariable
getName, getType
-
Methods inherited from class org.apache.calcite.rex.RexNode
isA, isA, isAlwaysFalse, isAlwaysTrue, toString
-
-
-
-
Constructor Detail
-
RexLocalRef
public RexLocalRef(int index, RelDataType type)
Creates a local variable.- Parameters:
index
- Index of the field in the underlying row typetype
- Type of the column
-
-
Method Detail
-
getKind
public SqlKind getKind()
Description copied from class:RexNode
Returns the kind of node this is.
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:RexNode
Every node must implement
RexNode.equals(java.lang.Object)
based on its content
-
hashCode
public int hashCode()
Description copied from class:RexNode
Every node must implement
RexNode.hashCode()
consistent withRexNode.equals(java.lang.Object)
-
accept
public <R> R accept(RexVisitor<R> visitor)
Description copied from class:RexNode
Accepts a visitor, dispatching to the right overloadedvisitXxx
method.Also see
RexUtil.apply(RexVisitor, java.util.List, RexNode)
, which applies a visitor to several expressions simultaneously.
-
accept
public <R,P> R accept(RexBiVisitor<R,P> visitor, P arg)
Description copied from class:RexNode
Accepts a visitor with a payload, dispatching to the right overloadedRexBiVisitor.visitInputRef(RexInputRef, Object)
visitXxx} method.
-
createName
private static java.lang.String createName(int index)
-
-