Class PathQueryNode

  • All Implemented Interfaces:
    Cloneable, QueryNode

    public class PathQueryNode
    extends QueryNodeImpl
    A 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);
     
    • Constructor Detail

      • PathQueryNode

        public PathQueryNode​(List<PathQueryNode.QueryText> pathElements)
        Parameters:
        pathElements - - List of QueryText objects
    • Method Detail

      • getPathElements

        public List<PathQueryNode.QueryText> getPathElements()
        Returns the a List with all QueryText elements
        Returns:
        QueryText List size
      • setPathElements

        public void setPathElements​(List<PathQueryNode.QueryText> elements)
        Returns the a List with all QueryText elements
      • getPathElement

        public PathQueryNode.QueryText getPathElement​(int index)
        Returns the a specific QueryText element
        Returns:
        QueryText List size
      • getFirstPathElement

        public CharSequence getFirstPathElement()
        Returns the CharSequence value of a specific QueryText element
        Returns:
        the CharSequence for a specific QueryText element
      • getPathElements

        public List<PathQueryNode.QueryText> getPathElements​(int startIndex)
        Returns a List QueryText element from position startIndex
        Returns:
        a List QueryText element from position startIndex