org.eigenbase.rel.rules
Class ReduceDecimalsRule.DecimalShuttle

java.lang.Object
  extended by org.eigenbase.rex.RexShuttle
      extended by org.eigenbase.rel.rules.ReduceDecimalsRule.DecimalShuttle
All Implemented Interfaces:
RexVisitor<RexNode>
Enclosing class:
ReduceDecimalsRule

public class ReduceDecimalsRule.DecimalShuttle
extends RexShuttle

A shuttle which converts decimal expressions to expressions based on longs.


Field Summary
private  ReduceDecimalsRule.ExpanderMap expanderMap
           
private  Map<String,RexNode> irreducible
           
private  Map<String,RexNode> results
           
 
Constructor Summary
ReduceDecimalsRule.DecimalShuttle(RexBuilder rexBuilder)
           
 
Method Summary
private  ReduceDecimalsRule.RexExpander getExpander(RexCall call)
          Returns a ReduceDecimalsRule.RexExpander for a call
private  RexNode lookup(RexNode node)
          Lookup registered node
private  void register(RexNode node, RexNode reducedNode)
          Registers node so it will not be computed again
private  RexNode rewriteCall(RexCall call)
          Rewrites a call, if required, or returns the original call
 RexNode visitCall(RexCall call)
          Rewrites a call in place, from bottom up, as follows: visit operands visit call node rewrite call visit the rewritten call
 
Methods inherited from class org.eigenbase.rex.RexShuttle
apply, apply, visitArray, visitCorrelVariable, visitDynamicParam, visitFieldAccess, visitInputRef, visitLiteral, visitLocalRef, visitOver, visitRangeRef, visitWindow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

irreducible

private final Map<String,RexNode> irreducible

results

private final Map<String,RexNode> results

expanderMap

private final ReduceDecimalsRule.ExpanderMap expanderMap
Constructor Detail

ReduceDecimalsRule.DecimalShuttle

public ReduceDecimalsRule.DecimalShuttle(RexBuilder rexBuilder)
Method Detail

visitCall

public RexNode visitCall(RexCall call)
Rewrites a call in place, from bottom up, as follows:
  1. visit operands
  2. visit call node
    1. rewrite call
    2. visit the rewritten call

Specified by:
visitCall in interface RexVisitor<RexNode>
Overrides:
visitCall in class RexShuttle

register

private void register(RexNode node,
                      RexNode reducedNode)
Registers node so it will not be computed again


lookup

private RexNode lookup(RexNode node)
Lookup registered node


rewriteCall

private RexNode rewriteCall(RexCall call)
Rewrites a call, if required, or returns the original call


getExpander

private ReduceDecimalsRule.RexExpander getExpander(RexCall call)
Returns a ReduceDecimalsRule.RexExpander for a call