org.teiid.query.sql.symbol
Class SearchedCaseExpression

java.lang.Object
  extended by org.teiid.query.sql.symbol.AbstractCaseExpression
      extended by org.teiid.query.sql.symbol.SearchedCaseExpression
All Implemented Interfaces:
Cloneable, LanguageObject, Expression

public class SearchedCaseExpression
extends AbstractCaseExpression


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.teiid.query.sql.LanguageObject
LanguageObject.Util
 
Constructor Summary
SearchedCaseExpression(List when, List then)
          Constructor for SearchedCaseExpression objects
 
Method Summary
 void acceptVisitor(LanguageVisitor visitor)
          Method for accepting a visitor.
 Object clone()
          Implement clone to make objects cloneable.
 boolean equals(Object obj)
           
 List getWhen()
          Gets the List of Criteria in the WHEN parts of this expression.
 int getWhenCount()
          Gets the number of WHEN and THEN parts this case expression contains.
 Criteria getWhenCriteria(int index)
          Gets the WHEN criteria at the given 0-based index.
 boolean isResolved()
          Return true if expression has been fully resolved.
 void setWhen(List when, List then)
          Sets the WHEN and THEN parts of this CASE expression.
 
Methods inherited from class org.teiid.query.sql.symbol.AbstractCaseExpression
getElseExpression, getThen, getThenExpression, getType, hashCode, setElseExpression, setThen, setType, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchedCaseExpression

public SearchedCaseExpression(List when,
                              List then)
Constructor for SearchedCaseExpression objects

Parameters:
when - a non-null List containing at least one Criteria
then - a non-null List containing at least one Expression
Method Detail

getWhenCount

public int getWhenCount()
Description copied from class: AbstractCaseExpression
Gets the number of WHEN and THEN parts this case expression contains. This number is always >= 1.

Specified by:
getWhenCount in class AbstractCaseExpression
Returns:
See Also:
AbstractCaseExpression.getWhenCount()

getWhen

public List getWhen()
Gets the List of Criteria in the WHEN parts of this expression. Never null.

Returns:

getWhenCriteria

public Criteria getWhenCriteria(int index)
Gets the WHEN criteria at the given 0-based index.

Parameters:
index -
Returns:

setWhen

public void setWhen(List when,
                    List then)
Sets the WHEN and THEN parts of this CASE expression. Both lists should have the same number of items.

Specified by:
setWhen in class AbstractCaseExpression
Parameters:
when - a non-null List of at least one Criteria
then - a non-null List of at least one Expression

isResolved

public boolean isResolved()
Description copied from interface: Expression
Return true if expression has been fully resolved. Typically the QueryResolver component will handle resolution of an expression.

Returns:
True if resolved
See Also:
Expression.isResolved()

acceptVisitor

public void acceptVisitor(LanguageVisitor visitor)
Description copied from interface: LanguageObject
Method for accepting a visitor. It is the responsibility of the language object to call back on the visitor.

Parameters:
visitor - Visitor being used

clone

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

Specified by:
clone in interface LanguageObject
Specified by:
clone in class AbstractCaseExpression
Returns:
Deep clone of this object
See Also:
Object.clone()

equals

public boolean equals(Object obj)
Overrides:
equals in class AbstractCaseExpression


Copyright © 2012. All Rights Reserved.