Stay organized with collections
Save and categorize content based on your preferences.
publicclassQueryTreeWalker<T>
The walking of the query tree. This class takes care of visiting
a tree resulting from parsing a query. As it traverses the tree
it calls appropriate methods of the visitor, set at the construction
time. The class uses a depth-first search, visiting all children
of a node, before visiting the node. The visit is done by calling
an appropriate method of the visitor. Typical code should match
the following pattern:
classMyVisitorimplementsQueryTreeVisitor{...}classMyContextextendsQueryTreeContext<MyContext>{...@OverrideprotectedMyContextnewChildContext(){returnnewMyContext();}}MyContextcontext=newMyContext();QueryTreeWalker<MyContext>walker=newQueryTreeWalker<MyContext>(newMyVisitor());Treeroot=parser.query(queryStr);walker.walk(root,context);// retrieve whatever information you need from context
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-19 UTC."],[],[]]