org.eigenbase.sql
Class SqlOperandCountRange

java.lang.Object
  extended by org.eigenbase.sql.SqlOperandCountRange

public class SqlOperandCountRange
extends Object

A class that describes how many operands an operator can take.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/SqlOperandCountRange.java#9 $
Author:
Wael Chatila

Field Summary
static SqlOperandCountRange Four
           
private  boolean isVariadic
           
static SqlOperandCountRange One
           
static SqlOperandCountRange OneOrTwo
           
private  List<Integer> possibleList
           
static SqlOperandCountRange Three
           
static SqlOperandCountRange ThreeOrFour
           
static SqlOperandCountRange Two
           
static SqlOperandCountRange TwoOrThree
           
static SqlOperandCountRange Variadic
           
static SqlOperandCountRange Zero
           
static SqlOperandCountRange ZeroOrOne
           
 
Constructor Summary
private SqlOperandCountRange()
          This constructor should only be called internally from this class and only when creating a variadic count descriptor
  SqlOperandCountRange(int count)
           
private SqlOperandCountRange(Integer[] possibleCounts)
           
  SqlOperandCountRange(int count1, int count2)
           
  SqlOperandCountRange(int count1, int count2, int count3)
           
  SqlOperandCountRange(List<Integer> list)
           
 
Method Summary
 List<Integer> getAllowedList()
          Returns a list of allowed operand counts for a non-variadic operator.
 boolean isVariadic()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Variadic

public static final SqlOperandCountRange Variadic

Zero

public static final SqlOperandCountRange Zero

ZeroOrOne

public static final SqlOperandCountRange ZeroOrOne

One

public static final SqlOperandCountRange One

OneOrTwo

public static final SqlOperandCountRange OneOrTwo

Two

public static final SqlOperandCountRange Two

TwoOrThree

public static final SqlOperandCountRange TwoOrThree

Three

public static final SqlOperandCountRange Three

ThreeOrFour

public static final SqlOperandCountRange ThreeOrFour

Four

public static final SqlOperandCountRange Four

possibleList

private List<Integer> possibleList

isVariadic

private boolean isVariadic
Constructor Detail

SqlOperandCountRange

private SqlOperandCountRange()
This constructor should only be called internally from this class and only when creating a variadic count descriptor


SqlOperandCountRange

private SqlOperandCountRange(Integer[] possibleCounts)

SqlOperandCountRange

public SqlOperandCountRange(int count)

SqlOperandCountRange

public SqlOperandCountRange(List<Integer> list)

SqlOperandCountRange

public SqlOperandCountRange(int count1,
                            int count2)

SqlOperandCountRange

public SqlOperandCountRange(int count1,
                            int count2,
                            int count3)
Method Detail

getAllowedList

public List<Integer> getAllowedList()
Returns a list of allowed operand counts for a non-variadic operator.

Returns:
unmodifiable list of Integer
"Precondition:"
!isVariadic()

isVariadic

public boolean isVariadic()
Returns:
true if any number of operands is allowed