org.teiid.query.sql.proc
Class CriteriaSelector

java.lang.Object
  extended by org.teiid.query.sql.proc.CriteriaSelector
All Implemented Interfaces:
java.lang.Cloneable, LanguageObject

public class CriteriaSelector
extends java.lang.Object
implements LanguageObject

This class represents the criteria present on the user's query. The type of criteria and the elements on which it is specified are listed in this object, this object is used by HasCriteria and TranslateCriteria objects to determine if a particular type of criteria is present on one or more elements on a user's query


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.teiid.query.sql.LanguageObject
LanguageObject.Util
 
Field Summary
static int BETWEEN
           
static int COMPARE_EQ
           
static int COMPARE_GE
           
static int COMPARE_GT
           
static int COMPARE_LE
           
static int COMPARE_LT
           
static int COMPARE_NE
           
static int IN
           
static int IS_NULL
           
static int LIKE
           
static int NO_TYPE
           
 
Constructor Summary
CriteriaSelector()
          Constructor for CriteriaSelector.
CriteriaSelector(int selectorType, java.util.List elements)
          Constructor for CriteriaSelector.
 
Method Summary
 void acceptVisitor(LanguageVisitor visitor)
          Method for accepting a visitor.
 void addElement(ElementSymbol element)
          Add an element to the collection of elements on which criteria is pecified on the user's query
 java.lang.Object clone()
          Deep clone statement to produce a new identical statement.
 boolean equals(java.lang.Object obj)
          Compare two CriteriaSelector for equality.
 java.util.List getElements()
          Get elements on which criteria is pecified on the user's query
 int getSelectorType()
          Get the type of criteria on the user query's elements
 boolean hasElements()
          Return a boolean indicating if the seletor has any elements
 int hashCode()
          Get hashcode for CriteriaSelector.
 void setElements(java.util.List elements)
          Set elements on which criteria is pecified on the user's query
 void setSelectorType(int type)
          Set the type of criteria on the user query's elements
 java.lang.String toString()
          Returns a string representation of an instance of this class.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPARE_EQ

public static final int COMPARE_EQ
See Also:
Constant Field Values

COMPARE_NE

public static final int COMPARE_NE
See Also:
Constant Field Values

COMPARE_LT

public static final int COMPARE_LT
See Also:
Constant Field Values

COMPARE_GT

public static final int COMPARE_GT
See Also:
Constant Field Values

COMPARE_LE

public static final int COMPARE_LE
See Also:
Constant Field Values

COMPARE_GE

public static final int COMPARE_GE
See Also:
Constant Field Values

LIKE

public static final int LIKE
See Also:
Constant Field Values

IN

public static final int IN
See Also:
Constant Field Values

IS_NULL

public static final int IS_NULL
See Also:
Constant Field Values

BETWEEN

public static final int BETWEEN
See Also:
Constant Field Values

NO_TYPE

public static final int NO_TYPE
See Also:
Constant Field Values
Constructor Detail

CriteriaSelector

public CriteriaSelector()
Constructor for CriteriaSelector.


CriteriaSelector

public CriteriaSelector(int selectorType,
                        java.util.List elements)
Constructor for CriteriaSelector.

Parameters:
selectorType - The type criteria presents on the elements
elements - The elements on which
Method Detail

getSelectorType

public int getSelectorType()
Get the type of criteria on the user query's elements

Returns:
An int value giving the type of criteria

setSelectorType

public void setSelectorType(int type)
Set the type of criteria on the user query's elements

Parameters:
type - The type of criteria

getElements

public java.util.List getElements()
Get elements on which criteria is pecified on the user's query

Returns:
A collection of elements used in criteria

setElements

public void setElements(java.util.List elements)
Set elements on which criteria is pecified on the user's query

Parameters:
elements - A collection of elements used in criteria

addElement

public void addElement(ElementSymbol element)
Add an element to the collection of elements on which criteria is pecified on the user's query

Parameters:
element - The elementSymbol object being added

hasElements

public boolean hasElements()
Return a boolean indicating if the seletor has any elements

Returns:
A boolean indicating if the seletor has any elements

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.

Specified by:
acceptVisitor in interface LanguageObject
Parameters:
visitor - Visitor being used

clone

public java.lang.Object clone()
Deep clone statement to produce a new identical statement.

Specified by:
clone in interface LanguageObject
Overrides:
clone in class java.lang.Object
Returns:
Deep clone

equals

public boolean equals(java.lang.Object obj)
Compare two CriteriaSelector for equality. They will only evaluate to equal if they are IDENTICAL: the selectorType and elements present are equal.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Other object
Returns:
True if equal

hashCode

public int hashCode()
Get hashcode for CriteriaSelector. WARNING: This hash code relies on the hash codes of the elements and the selectortype on this object. Hash code is only valid after the block has been completely constructed.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code

toString

public java.lang.String toString()
Returns a string representation of an instance of this class.

Overrides:
toString in class java.lang.Object
Returns:
String representation of object


Copyright © 2011. All Rights Reserved.