|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.query.sql.LanguageVisitor
com.metamatrix.query.sql.visitor.ElementCollectorVisitor
public class ElementCollectorVisitor
This visitor class will traverse a language object tree and collect all element symbol references it finds. It uses a collection to collect the elements in so different collections will give you different collection properties - for instance, using a Set will remove duplicates.
The easiest way to use this visitor is to call the static methods which create the visitor (and possibly the collection), run the visitor, and return the collection. The public visit() methods should NOT be called directly.
Constructor Summary | |
---|---|
ElementCollectorVisitor(java.util.Collection elements)
Construct a new visitor with the specified collection, which should be non-null. |
Method Summary | |
---|---|
java.util.Collection |
getElements()
Get the elements collected by the visitor. |
static void |
getElements(java.util.Collection<LanguageObject> objs,
java.util.Collection elements)
|
static java.util.Collection<ElementSymbol> |
getElements(LanguageObject obj,
boolean removeDuplicates)
Helper to quickly get the elements from obj in a collection. |
static java.util.Collection |
getElements(LanguageObject obj,
boolean removeDuplicates,
boolean useDeepIteration)
Helper to quickly get the elements from obj in a collection. |
static void |
getElements(LanguageObject obj,
java.util.Collection elements)
Helper to quickly get the elements from obj in the elements collection |
void |
visit(AllInGroupSymbol obj)
Visit a language object and collect symbols. |
void |
visit(AllSymbol obj)
Visit a language object and collect symbols. |
void |
visit(ElementSymbol obj)
Visit a language object and collect symbols. |
Methods inherited from class com.metamatrix.query.sql.LanguageVisitor |
---|
setAbort, shouldAbort, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ElementCollectorVisitor(java.util.Collection elements)
elements
- Collection to use for elements
java.lang.IllegalArgumentException
- If elements is nullMethod Detail |
---|
public java.util.Collection getElements()
ElementSymbol
public void visit(ElementSymbol obj)
visit
in class LanguageVisitor
obj
- Language objectpublic void visit(AllInGroupSymbol obj)
visit
in class LanguageVisitor
obj
- Language objectpublic void visit(AllSymbol obj)
visit
in class LanguageVisitor
obj
- Language objectpublic static final void getElements(LanguageObject obj, java.util.Collection elements)
obj
- Language objectelements
- Collection to collect elements inpublic static final void getElements(java.util.Collection<LanguageObject> objs, java.util.Collection elements)
public static final java.util.Collection<ElementSymbol> getElements(LanguageObject obj, boolean removeDuplicates)
obj
- Language objectremoveDuplicates
- True to remove duplicates
ElementSymbol
public static final java.util.Collection getElements(LanguageObject obj, boolean removeDuplicates, boolean useDeepIteration)
obj
- Language objectremoveDuplicates
- True to remove duplicatesuseDeepIteration
- indicates whether or not to iterate into nested
subqueries of the query
ElementSymbol
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |