com.metamatrix.query.sql.lang
Class SetCriteria
java.lang.Object
com.metamatrix.query.sql.lang.Criteria
com.metamatrix.query.sql.lang.PredicateCriteria
com.metamatrix.query.sql.lang.AbstractSetCriteria
com.metamatrix.query.sql.lang.SetCriteria
- All Implemented Interfaces:
- LanguageObject, ValueIteratorProvider, java.io.Serializable, java.lang.Cloneable
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 " IN (, ...)".
- See Also:
- Serialized Form
Constructor Summary |
SetCriteria()
Constructs a default instance of this class. |
SetCriteria(Expression expression,
java.util.Collection values)
Constructs an instance of this class with the membership expression and value expressions |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
SetCriteria
public SetCriteria()
- Constructs a default instance of this class.
SetCriteria
public SetCriteria(Expression expression,
java.util.Collection values)
- Constructs an instance of this class with the membership expression and value expressions
- Parameters:
expression
- The membership expressionvalues
- The set of value Expression
s
getNumberOfValues
public int getNumberOfValues()
- Returns the number of values in the set.
- Returns:
- Number of values in set
getValues
public java.util.List 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(java.util.Collection values)
- Sets the values in the set.
- Parameters:
values
- The set of value Expressions
getValueIterator
public ValueIterator getValueIterator()
- Returns a new instance of a ValueIterator
- Specified by:
getValueIterator
in interface ValueIteratorProvider
- Specified by:
getValueIterator
in class AbstractSetCriteria
- Returns:
- new ValueIterator instance
- See Also:
AbstractSetCriteria.getValueIterator()
setValueIterator
public void setValueIterator(ValueIterator valueIterator)
- This method is purposely not implemented. The values are
set through the constructor or the
setValues(java.util.Collection)
method.
- Specified by:
setValueIterator
in interface ValueIteratorProvider
- Specified by:
setValueIterator
in class AbstractSetCriteria
- Parameters:
valueIterator
- an instance of ValueIterator to be set
on this ValueIterator provider (as in the case of subquery
containers whose results are provided externally).- See Also:
ValueIteratorProvider.setValueIterator(com.metamatrix.query.sql.util.ValueIterator)
set
public void set(Expression expression,
java.util.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.
- Overrides:
hashCode
in class java.lang.Object
- Returns:
- Hash code
equals
public boolean equals(java.lang.Object obj)
- Override equals() method.
- Overrides:
equals
in class java.lang.Object
- Parameters:
obj
- Other object
- Returns:
- True if equal
clone
public java.lang.Object clone()
- Deep copy of object
- Specified by:
clone
in interface LanguageObject
- Specified by:
clone
in class AbstractSetCriteria
- Returns:
- Deep copy of object
Copyright © 2009. All Rights Reserved.