public final class TreeMatchResult<V> extends Object
final Tree<String, ?> tree = ...;
final TreePattern<String> pattern = ...;
final Optional<TreeMatchResult<String>> result = pattern.match(tree);
result.ifPresent(r -> {assert r.tree() == tree;});
TreePattern.match(Tree)
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
String |
toString() |
Tree<V,?> |
tree()
The node (tree), which has been matched by some pattern.
|
Map<TreePattern.Var<V>,Tree<V,?>> |
vars()
The variables involved while matching the tree
tree() . |
public Tree<V,?> tree()
TreePattern.match(Tree)
call, in the case of a
match.
final Tree<String, ?> tree = ...;
final TreePattern<String> pattern = ...;
final Optional<TreeMatchResult<String>> result = pattern.match(tree);
result.ifPresent(r -> {assert r.tree() == tree;});
public Map<TreePattern.Var<V>,Tree<V,?>> vars()
tree()
.tree()
.© 2007-2019 Franz Wilhelmstötter (2019-11-18 20:30)