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(java.util.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
|
java.lang.CharSequence |
getFirstPathElement()
Returns the CharSequence value of a specific QueryText element
|
PathQueryNode.QueryText |
getPathElement(int index)
Returns the a specific QueryText element
|
java.util.List<PathQueryNode.QueryText> |
getPathElements()
Returns the a List with all QueryText elements
|
java.util.List<PathQueryNode.QueryText> |
getPathElements(int startIndex)
Returns a List QueryText element from position startIndex
|
void |
setPathElements(java.util.List<PathQueryNode.QueryText> elements)
Returns the a List with all QueryText elements
|
java.lang.CharSequence |
toQueryString(EscapeQuerySyntax escaper)
convert to a query string understood by the query parser
|
java.lang.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(java.util.List<PathQueryNode.QueryText> pathElements)
pathElements - - List of QueryText objectspublic java.util.List<PathQueryNode.QueryText> getPathElements()
public void setPathElements(java.util.List<PathQueryNode.QueryText> elements)
public PathQueryNode.QueryText getPathElement(int index)
public java.lang.CharSequence getFirstPathElement()
public java.util.List<PathQueryNode.QueryText> getPathElements(int startIndex)
public java.lang.CharSequence toQueryString(EscapeQuerySyntax escaper)
QueryNodepublic java.lang.String toString()
QueryNodeImpltoString in interface QueryNodetoString in class QueryNodeImplQueryNode.toString()public QueryNode cloneTree() throws java.lang.CloneNotSupportedException
QueryNodecloneTree in interface QueryNodecloneTree in class QueryNodeImpljava.lang.CloneNotSupportedExceptionCopyright © 2000-2022 Apache Software Foundation. All Rights Reserved.