public class PathQueryNode extends QueryNodeImpl
PathQueryNode is used to store queries like
/company/USA/California /product/shoes/brown. QueryText are objects that
contain the text, begin position and end position in the query.
Example how the text parser creates these objects:
List values = ArrayList();
values.add(new PathQueryNode.QueryText("company", 1, 7));
values.add(new PathQueryNode.QueryText("USA", 9, 12));
values.add(new PathQueryNode.QueryText("California", 14, 23));
QueryNode q = new PathQueryNode(values);
| Modifier and Type | Class and Description |
|---|---|
static class |
PathQueryNode.QueryText |
PLAINTEXT_FIELD_NAME, toQueryStringIgnoreFields| Constructor and Description |
|---|
PathQueryNode(List<PathQueryNode.QueryText> pathElements) |
| Modifier and Type | Method and Description |
|---|---|
QueryNode |
cloneTree()
Recursive clone the QueryNode tree The tags are not copied to the new tree
when you call the cloneTree() method
|
CharSequence |
getFirstPathElement()
Returns the CharSequence value of a specific QueryText element
|
PathQueryNode.QueryText |
getPathElement(int index)
Returns the a specific QueryText element
|
List<PathQueryNode.QueryText> |
getPathElements()
Returns the a List with all QueryText elements
|
List<PathQueryNode.QueryText> |
getPathElements(int startIndex)
Returns a List QueryText element from position startIndex
|
void |
setPathElements(List<PathQueryNode.QueryText> elements)
Returns the a List with all QueryText elements
|
CharSequence |
toQueryString(EscapeQuerySyntax escaper)
convert to a query string understood by the query parser
|
String |
toString()
Every implementation of this class should return pseudo xml like this:
For FieldQueryNode:
|
add, add, allocate, clone, containsTag, containsTag, getChildren, getParent, getTag, getTag, getTagMap, getTags, isDefaultField, isLeaf, isRoot, set, setLeaf, setTag, setTag, unsetTag, unsetTagpublic PathQueryNode(List<PathQueryNode.QueryText> pathElements)
pathElements - - List of QueryText objectspublic List<PathQueryNode.QueryText> getPathElements()
public void setPathElements(List<PathQueryNode.QueryText> elements)
public PathQueryNode.QueryText getPathElement(int index)
public CharSequence getFirstPathElement()
public List<PathQueryNode.QueryText> getPathElements(int startIndex)
public CharSequence toQueryString(EscapeQuerySyntax escaper)
QueryNodepublic String toString()
QueryNodeImpltoString in interface QueryNodetoString in class QueryNodeImplQueryNode.toString()public QueryNode cloneTree() throws CloneNotSupportedException
QueryNodecloneTree in interface QueryNodecloneTree in class QueryNodeImplCloneNotSupportedException