com.metamatrix.query.sql.symbol
Class AbstractCaseExpression

java.lang.Object
  extended by com.metamatrix.query.sql.symbol.AbstractCaseExpression
All Implemented Interfaces:
LanguageObject, Expression, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
CaseExpression, SearchedCaseExpression

public abstract class AbstractCaseExpression
extends java.lang.Object
implements Expression

See Also:
Serialized Form

Constructor Summary
protected AbstractCaseExpression()
           
 
Method Summary
abstract  java.lang.Object clone()
          Implement clone to make objects cloneable.
 boolean equals(java.lang.Object obj)
           
 Expression getElseExpression()
          Gets the expression in the ELSE part of this expression.
 java.util.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.
 java.lang.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(java.util.List then)
          Sets the List of THEN expressions in this CASE expression
 void setType(java.lang.Class type)
          Sets the type to which this expression has resolved.
abstract  void setWhen(java.util.List whens, java.util.List thens)
           
 java.lang.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 com.metamatrix.query.sql.symbol.Expression
isResolved
 
Methods inherited from interface com.metamatrix.query.sql.LanguageObject
acceptVisitor
 

Constructor Detail

AbstractCaseExpression

protected AbstractCaseExpression()
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 java.util.List getThen()
Gets the List of THEN expressions in this CASE expression. Never null.

Returns:

setThen

protected void setThen(java.util.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 java.lang.Class getType()
Description copied from interface: Expression
Get the return type of this expression. This method will not necessarily work right before resolution (Expression.isResolved() returns true).

Specified by:
getType in interface Expression
Returns:
Java class name
See Also:
Expression.getType()

setType

public void setType(java.lang.Class type)
Sets the type to which this expression has resolved.

Parameters:
type -

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

clone

public abstract java.lang.Object clone()
Description copied from interface: LanguageObject
Implement clone to make objects cloneable.

Specified by:
clone in interface LanguageObject
Overrides:
clone in class java.lang.Object
Returns:
Deep clone of this object

toString

public java.lang.String toString()
Return a String representation of this object using SQLStringVisitor.

Overrides:
toString in class java.lang.Object
Returns:
String representation using SQLStringVisitor

setWhen

public abstract void setWhen(java.util.List whens,
                             java.util.List thens)


Copyright © 2009. All Rights Reserved.