org.eigenbase.rex
Class RexMultisetUtil

java.lang.Object
  extended by org.eigenbase.rex.RexMultisetUtil

public class RexMultisetUtil
extends Object

Utility class for various methods related to multisets.

Since:
Apr 4, 2005
Version:
$Id: //open/dev/farrago/src/org/eigenbase/rex/RexMultisetUtil.java#14 $
Author:
Wael Chatila

Nested Class Summary
private static class RexMultisetUtil.RexCallMultisetOperatorCounter
          A RexShuttle that traverse all RexNode and counts total number of RexCalls traversed and number of multiset calls traversed.
 
Field Summary
private static Set multisetOperators
          A set defining all implementable multiset calls
static SqlStdOperatorTable opTab
           
 
Constructor Summary
RexMultisetUtil()
           
 
Method Summary
static boolean containsMixing(RexNode node)
          Returns true if a node contains a mixing between multiset and non-multiset calls.
static boolean containsMixing(RexProgram program)
          Returns true if any expression in a program contains a mixing between multiset and non-multiset calls.
static boolean containsMultiset(RexNode node, boolean deep)
          Returns true if node contains a multiset operator, otherwise false.
static boolean containsMultiset(RexProgram program)
          Returns whether a program contains a multiset.
private static Set createMultisetOperatorSet()
           
static RexCall findFirstMultiset(RexNode node, boolean deep)
          Returns a reference to the first found multiset call or null if none was found
static boolean isMultisetCast(RexCall call)
          Returns true if call is call to CAST and the to/from cast types are of multiset types
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

multisetOperators

private static final Set multisetOperators
A set defining all implementable multiset calls


opTab

public static final SqlStdOperatorTable opTab
Constructor Detail

RexMultisetUtil

public RexMultisetUtil()
Method Detail

createMultisetOperatorSet

private static final Set createMultisetOperatorSet()

containsMixing

public static boolean containsMixing(RexProgram program)
Returns true if any expression in a program contains a mixing between multiset and non-multiset calls.


containsMixing

public static boolean containsMixing(RexNode node)
Returns true if a node contains a mixing between multiset and non-multiset calls.


containsMultiset

public static boolean containsMultiset(RexNode node,
                                       boolean deep)
Returns true if node contains a multiset operator, otherwise false. Use it with deep=false when checking if a RexCall is a multiset call.

Parameters:
node - Expression
deep - If true, returns whether expression contains a multiset. If false, returns whether expression is a multiset.

containsMultiset

public static boolean containsMultiset(RexProgram program)
Returns whether a program contains a multiset.


isMultisetCast

public static boolean isMultisetCast(RexCall call)
Returns true if call is call to CAST and the to/from cast types are of multiset types


findFirstMultiset

public static RexCall findFirstMultiset(RexNode node,
                                        boolean deep)
Returns a reference to the first found multiset call or null if none was found