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
Term text with a beginning and end position
|
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: <field start='1' end='2' field='subject' text='foo'/>
|
add, add, allocate, clone, containsTag, getChildren, getParent, getTag, getTagMap, isDefaultField, isLeaf, isRoot, removeFromParent, set, setLeaf, setTag, unsetTag
public 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)
QueryNode
public String toString()
QueryNodeImpl
toString
in interface QueryNode
toString
in class QueryNodeImpl
QueryNode.toString()
public QueryNode cloneTree() throws CloneNotSupportedException
QueryNode
cloneTree
in interface QueryNode
cloneTree
in class QueryNodeImpl
CloneNotSupportedException
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.