com.metamatrix.query.sql.proc
Class TranslateCriteria

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.proc.TranslateCriteria
All Implemented Interfaces:
LanguageObject, java.io.Serializable, java.lang.Cloneable

public class TranslateCriteria
extends PredicateCriteria

This object represents the criteria used in the stored procedure language that translates the portion of the user's criteria by doing symbol mapping to the elements of the physical group that defines the virtual group and translating the user's criteria using the element-expressions pairs represented as a list of comapreCriteria on this this object.

See Also:
Serialized Form

Constructor Summary
TranslateCriteria()
          Constructor for TranslateCriteria.
TranslateCriteria(CriteriaSelector selector)
          Constructor for TranslateCriteria.
TranslateCriteria(CriteriaSelector selector, java.util.List translations)
          Constructor for TranslateCriteria.
 
Method Summary
 void acceptVisitor(LanguageVisitor visitor)
          Method for accepting a visitor.
 void addTranslation(CompareCriteria criteria)
          Add a comparecriteria(element-value pair) to the list used to translate the user's criteria.
 java.lang.Object clone()
          Deep clone statement to produce a new identical statement.
 boolean equals(java.lang.Object obj)
          Compare two TranslateCriteria for equality.
 CriteriaSelector getSelector()
          Get the CriteriaSelector
 java.util.List getTranslations()
          Get a list of comparecriteria(element-value pairs) used to translate the user's criteria.
 int hashCode()
          Get hashcode for TranslateCriteria.
 boolean hasTranslations()
          Return a boolean indicating if the object has any translations.
 void setSelector(CriteriaSelector selector)
          Set the CriteriaSelector
 void setTranslations(java.util.List translations)
          Set a list of comparecriteria(element-value pairs) used to translate the user's criteria.
 java.lang.String toString()
          Returns a string representation of an instance of this class.
 
Methods inherited from class com.metamatrix.query.sql.lang.Criteria
combineCriteria, combineCriteria, combineCriteria, separateCriteriaByAnd, toConjunctiveNormalForm, toDisjunctiveNormalForm
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TranslateCriteria

public TranslateCriteria()
Constructor for TranslateCriteria.


TranslateCriteria

public TranslateCriteria(CriteriaSelector selector)
Constructor for TranslateCriteria.

Parameters:
selector - The CriteriaSelector of this obj

TranslateCriteria

public TranslateCriteria(CriteriaSelector selector,
                         java.util.List translations)
Constructor for TranslateCriteria.

Parameters:
selector - The CriteriaSelector of this obj
critCollect - A list of comparecriteria used to translate user's criteria
Method Detail

getSelector

public CriteriaSelector getSelector()
Get the CriteriaSelector

Returns:
CriteriaSelector of this obj

setSelector

public void setSelector(CriteriaSelector selector)
Set the CriteriaSelector

Parameters:
selector - The CriteriaSelector of this obj

hasTranslations

public boolean hasTranslations()
Return a boolean indicating if the object has any translations.

Returns:
A boolean indicating if the object has any translations

setTranslations

public void setTranslations(java.util.List translations)
Set a list of comparecriteria(element-value pairs) used to translate the user's criteria.

Parameters:
critCollect - A list of criteria used to translate user's criteria

addTranslation

public void addTranslation(CompareCriteria criteria)
Add a comparecriteria(element-value pair) to the list used to translate the user's criteria.

Parameters:
criteria - A ComapareCriteria object to be added to a collection

getTranslations

public java.util.List getTranslations()
Get a list of comparecriteria(element-value pairs) used to translate the user's criteria.

Returns:
A list of criteria used to translate user's criteria

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

clone

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

Specified by:
clone in interface LanguageObject
Specified by:
clone in class PredicateCriteria
Returns:
Deep clone

equals

public boolean equals(java.lang.Object obj)
Compare two TranslateCriteria for equality. They will only evaluate to equal if they are IDENTICAL: the criteriaSelectors are equal.

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

hashCode

public int hashCode()
Get hashcode for TranslateCriteria. WARNING: This hash code relies on the hash code of the criteria selector on this object. Hash code is only valid after the object 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 Criteria
Returns:
String representation of object


Copyright © 2009. All Rights Reserved.