Class QueryMatch


  • public class QueryMatch
    extends Object
    Represents a collection of captured nodes, matched with a single Query pattern.
    Since:
    1.0.0
    Author:
    Ozren Dabić
    • Method Detail

      • getCaptures

        public Map<Capture,​Collection<Node>> getCaptures()
        Retrieves a mapping between the captures and captured nodes in this match.
        Returns:
        a map of captures and the nodes they captured
        Since:
        1.7.0
      • getNodes

        public Collection<Node> getNodes()
        Retrieves all the captured nodes from this match.
        Returns:
        a collection of captured nodes
        Since:
        1.7.0
      • getNodes

        public Collection<Node> getNodes​(Capture capture)
        Retrieves all nodes captured under a specific capture.
        Parameters:
        capture - the query capture
        Returns:
        a collection of captured nodes
        Since:
        1.7.0
      • getNodes

        public Collection<Node> getNodes​(String name)
        Retrieves all nodes captured under a specific capture with the given name.
        Parameters:
        name - the name of the query capture
        Returns:
        a collection of captured nodes
        Since:
        1.7.0
      • getPatternIndex

        @Deprecated(since="1.7.0",
                    forRemoval=true)
        public int getPatternIndex()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use dedicated pattern getter instead