Package org.teiid.query.sql.symbol
Class AbstractCaseExpression
- java.lang.Object
-
- org.teiid.query.sql.symbol.AbstractCaseExpression
-
- All Implemented Interfaces:
Cloneable
,LanguageObject
,Expression
- Direct Known Subclasses:
CaseExpression
,SearchedCaseExpression
public abstract class AbstractCaseExpression extends Object implements Expression
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.teiid.query.sql.LanguageObject
LanguageObject.Util
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCaseExpression()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Object
clone()
Implement clone to make objects cloneable.boolean
equals(Object obj)
Expression
getElseExpression()
Gets the expression in the ELSE part of this expression.List
getThen()
Gets the List of THEN expressions in this CASE expression.Expression
getThenExpression(int index)
Gets the expression of the THEN part at the given index.Class
getType()
Get the return type of this expression.abstract int
getWhenCount()
Gets the number of WHEN and THEN parts this case expression contains.int
hashCode()
void
setElseExpression(Expression elseExpression)
Sets the expression in the ELSE part of this expression.protected void
setThen(List then)
Sets the List of THEN expressions in this CASE expressionvoid
setType(Class type)
Sets the type to which this expression has resolved.abstract void
setWhen(List whens, List thens)
String
toString()
Return a String representation of this object using SQLStringVisitor.-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.teiid.query.sql.LanguageObject
acceptVisitor
-
-
-
-
Method Detail
-
getWhenCount
public abstract int getWhenCount()
Gets the number of WHEN and THEN parts this case expression contains. This number is always >= 1.- Returns:
-
getThenExpression
public Expression getThenExpression(int index)
Gets the expression of the THEN part at the given index.- Parameters:
index
-- Returns:
-
getThen
public List getThen()
Gets the List of THEN expressions in this CASE expression. Never null.- Returns:
-
setThen
protected void setThen(List then)
Sets the List of THEN expressions in this CASE expression- Parameters:
then
-
-
getElseExpression
public Expression getElseExpression()
Gets the expression in the ELSE part of this expression. May be null as the ELSE is optional.- Returns:
-
setElseExpression
public void setElseExpression(Expression elseExpression)
Sets the expression in the ELSE part of this expression. Can be null.- Parameters:
elseExpression
-
-
getType
public Class getType()
Description copied from interface:Expression
Get the return type of this expression.- Specified by:
getType
in interfaceExpression
- Returns:
- Java class may be null prior to being resolved
- See Also:
Expression.getType()
-
setType
public void setType(Class type)
Sets the type to which this expression has resolved.- Parameters:
type
-
-
clone
public abstract Object clone()
Description copied from interface:LanguageObject
Implement clone to make objects cloneable.- Specified by:
clone
in interfaceLanguageObject
- Overrides:
clone
in classObject
- Returns:
- Deep clone of this object
-
toString
public String toString()
Return a String representation of this object using SQLStringVisitor.
-
-