Package ch.usi.si.seart.treesitter
Class QueryMatch
- java.lang.Object
-
- ch.usi.si.seart.treesitter.QueryMatch
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Map<Capture,Collection<Node>>getCaptures()Retrieves a mapping between the captures and captured nodes in this match.Collection<Node>getNodes()Retrieves all the captured nodes from this match.Collection<Node>getNodes(Capture capture)Retrieves all nodes captured under a specific capture.Collection<Node>getNodes(String name)Retrieves all nodes captured under a specific capture with the given name.intgetPatternIndex()Deprecated, for removal: This API element is subject to removal in a future version.Use dedicatedpatterngetter insteadStringtoString()
-
-
-
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 dedicatedpatterngetter instead
-
-