org.teiid.query.sql.lang
Class BetweenCriteria

java.lang.Object
  extended by org.teiid.query.sql.lang.Criteria
      extended by org.teiid.query.sql.lang.PredicateCriteria
          extended by org.teiid.query.sql.lang.BetweenCriteria
All Implemented Interfaces:
Cloneable, PredicateCriteria.Negatable, LanguageObject, Expression

public class BetweenCriteria
extends PredicateCriteria
implements PredicateCriteria.Negatable

Represents criteria such as: " [NOT] BETWEEN AND ".


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
BetweenCriteria()
          Constructs a default instance of this class.
BetweenCriteria(Expression expression, Expression lowerExpression, Expression upperExpression)
          Constructs an instance of this class with an expression
 
Method Summary
 void acceptVisitor(LanguageVisitor visitor)
          Method for accepting a visitor.
 Object clone()
          Deep copy of object
 boolean equals(Object obj)
          Comparees this criteria to another object for equality
 Expression getExpression()
          Get expression.
 Expression getLowerExpression()
          Get the lower expression.
 Expression getUpperExpression()
          Get the upper expression.
 int hashCode()
          Get hash code.
 boolean isNegated()
          Returns whether this criteria is negated.
 void negate()
           
 void setExpression(Expression expression)
          Set expression.
 void setLowerExpression(Expression lowerExpression)
          Set the lower expression.
 void setNegated(boolean negationFlag)
          Sets the negation flag for this criteria.
 void setUpperExpression(Expression upperExpression)
          Set the upper expression.
 
Methods inherited from class org.teiid.query.sql.lang.Criteria
applyDemorgan, combineCriteria, combineCriteria, combineCriteria, getType, isResolved, separateCriteriaByAnd, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BetweenCriteria

public BetweenCriteria()
Constructs a default instance of this class.


BetweenCriteria

public BetweenCriteria(Expression expression,
                       Expression lowerExpression,
                       Expression upperExpression)
Constructs an instance of this class with an expression

Parameters:
expression - The expression to be compared to null
Method Detail

setExpression

public void setExpression(Expression expression)
Set expression.

Parameters:
expression - Expression to compare to the upper and lower values

getExpression

public Expression getExpression()
Get expression.

Returns:
Expression to compare

setLowerExpression

public void setLowerExpression(Expression lowerExpression)
Set the lower expression.

Parameters:
expression - the lower expression

getLowerExpression

public Expression getLowerExpression()
Get the lower expression.

Returns:
the lower expression

setUpperExpression

public void setUpperExpression(Expression upperExpression)
Set the upper expression.

Parameters:
expression - the upper expression

getUpperExpression

public Expression getUpperExpression()
Get the upper expression.

Returns:
the upper 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

acceptVisitor

public void acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor. It is the responsibility of the language object to use the visitor's iterator to call acceptVisitor on the "next" object, according to the iteration strategy.

Specified by:
acceptVisitor in interface LanguageObject
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 Object
Returns:
Hash code for object

equals

public boolean equals(Object obj)
Comparees this criteria to another object for equality

Overrides:
equals in class Object
Parameters:
obj - Other object
Returns:
True if objects are equal

clone

public Object clone()
Deep copy of object

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

negate

public void negate()
Specified by:
negate in interface PredicateCriteria.Negatable


Copyright © 2012. All Rights Reserved.