Package org.teiid.query.sql.lang
Class SetCriteria
- java.lang.Object
-
- org.teiid.query.sql.lang.Criteria
-
- org.teiid.query.sql.lang.PredicateCriteria
-
- org.teiid.query.sql.lang.AbstractSetCriteria
-
- org.teiid.query.sql.lang.SetCriteria
-
- All Implemented Interfaces:
Cloneable
,PredicateCriteria.Negatable
,LanguageObject
,Expression
public class SetCriteria extends AbstractSetCriteria
A criteria which is true is the expression's value is a member in a list of values. This criteria can be represented as "<expression> IN (<expr>, ...)".
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.teiid.query.sql.lang.PredicateCriteria
PredicateCriteria.Negatable
-
Nested classes/interfaces inherited from interface org.teiid.query.sql.LanguageObject
LanguageObject.Util
-
-
Constructor Summary
Constructors Constructor Description SetCriteria()
Constructs a default instance of this class.SetCriteria(Expression expression, Collection values)
Constructs an instance of this class with the membership expression and value expressions
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor.Object
clone()
Deep copy of objectboolean
equals(Object obj)
Override equals() method.int
getNumberOfValues()
Returns the number of values in the set.Collection
getValues()
Returns the set of values.int
hashCode()
Get hash code.boolean
isAllConstants()
void
set(Expression expression, Collection values)
Sets the membership expression and the set of value expressionsvoid
setAllConstants(boolean allConstants)
void
setValues(Collection values)
Sets the values in the set.-
Methods inherited from class org.teiid.query.sql.lang.AbstractSetCriteria
getExpression, isNegated, negate, setExpression, setNegated
-
Methods inherited from class org.teiid.query.sql.lang.Criteria
applyDemorgan, combineCriteria, combineCriteria, combineCriteria, getType, separateCriteriaByAnd, toString
-
-
-
-
Constructor Detail
-
SetCriteria
public SetCriteria()
Constructs a default instance of this class.
-
SetCriteria
public SetCriteria(Expression expression, Collection values)
Constructs an instance of this class with the membership expression and value expressions- Parameters:
expression
- The membership expressionvalues
- The set of valueExpression
s
-
-
Method Detail
-
getNumberOfValues
public int getNumberOfValues()
Returns the number of values in the set.- Returns:
- Number of values in set
-
getValues
public Collection getValues()
Returns the set of values. Returns an empty collection if there are currently no values.- Returns:
- The collection of Expression values
-
setValues
public void setValues(Collection values)
Sets the values in the set.- Parameters:
values
- The set of value Expressions
-
set
public void set(Expression expression, Collection values)
Sets the membership expression and the set of value expressions- Parameters:
expression
- The membership expressionvalues
- The set of value expressions
-
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
-
hashCode
public int hashCode()
Get hash code. WARNING: The hash code is based on data in the criteria. If data values are changed, the hash code will change - don't hash this object and change values.
-
equals
public boolean equals(Object obj)
Override equals() method.
-
clone
public Object clone()
Deep copy of object- Specified by:
clone
in interfaceLanguageObject
- Specified by:
clone
in classAbstractSetCriteria
- Returns:
- Deep copy of object
-
isAllConstants
public boolean isAllConstants()
-
setAllConstants
public void setAllConstants(boolean allConstants)
-
-