com.metamatrix.query.sql.lang
Class AbstractSetCriteria

java.lang.Object
  extended by com.metamatrix.query.sql.lang.Criteria
      extended by com.metamatrix.query.sql.lang.PredicateCriteria
          extended by com.metamatrix.query.sql.lang.AbstractSetCriteria
All Implemented Interfaces:
LanguageObject, ValueIteratorProvider, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
DependentSetCriteria, SetCriteria, SubquerySetCriteria

public abstract class AbstractSetCriteria
extends PredicateCriteria
implements ValueIteratorProvider

This is an abstract class to define some common functionality in the two varieties of IN criteria: SetCriteria (where values are specified) and SubquerySetCriteria (where a subquery is defined and will supply the values for the IN set).

See Also:
Serialized Form

Constructor Summary
protected AbstractSetCriteria()
          Constructor for AbstractSetCriteria.
 
Method Summary
abstract  java.lang.Object clone()
          Deep copy of object
 Expression getExpression()
          Gets the membership expression to be compared.
abstract  ValueIterator getValueIterator()
          Returns a ValueIterator over the Collection of values that the Criteria tests the Expression for inclusion in.
 boolean isNegated()
          Returns whether this criteria is negated.
 void setExpression(Expression expression)
          Sets the membership expression
 void setNegated(boolean negationFlag)
          Sets the negation flag for this criteria.
abstract  void setValueIterator(ValueIterator valueIterator)
          Sets the ValueIterator instance on this object.
 
Methods inherited from class com.metamatrix.query.sql.lang.Criteria
combineCriteria, combineCriteria, combineCriteria, separateCriteriaByAnd, toConjunctiveNormalForm, toDisjunctiveNormalForm, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.metamatrix.query.sql.LanguageObject
acceptVisitor
 

Constructor Detail

AbstractSetCriteria

protected AbstractSetCriteria()
Constructor for AbstractSetCriteria.

Method Detail

getExpression

public Expression getExpression()
Gets the membership expression to be compared.

Returns:
The membership expression

setExpression

public void setExpression(Expression expression)
Sets the membership expression

Parameters:
expression - The membership expression

isNegated

public boolean isNegated()
Returns whether this criteria is negated.

Returns:
flag indicating whether this criteria contains a NOT

setNegated

public void setNegated(boolean negationFlag)
Sets the negation flag for this criteria.

Parameters:
negationFlag - true if this criteria contains a NOT; false otherwise

getValueIterator

public abstract ValueIterator getValueIterator()

Returns a ValueIterator over the Collection of values that the Criteria tests the Expression for inclusion in. This method allows implementors leeway in how the Collection of values of this Criteria are stored.

Subclasses must take care that a ValueIterator returned from this method is always reset to the beginning of the iteration.

Also note that no guarantee is made as to whether or not the same ValueIterator instance is returned by multiple calls to this method, or if a new ValueIterator instance is returned. Clients must be aware that the same instance might be returned multiple times, and modifying the state of one will affect anything else using that reference.

Specified by:
getValueIterator in interface ValueIteratorProvider
Returns:
ValueIterator over the Collection of values that the left Expression is tested for inclusion in

setValueIterator

public abstract void setValueIterator(ValueIterator valueIterator)
Sets the ValueIterator instance on this object. Subclasses may choose to implement with a no-op method.

Specified by:
setValueIterator in interface ValueIteratorProvider
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)

clone

public abstract java.lang.Object clone()
Deep copy of object

Specified by:
clone in interface LanguageObject
Specified by:
clone in class PredicateCriteria
Returns:
Deep copy of object


Copyright © 2009. All Rights Reserved.