Class ASTMatcher
For example, to compute whether two ASTs subtrees are structurally
isomorphic, use n1.subtreeMatch(new ASTMatcher(), n2) where
n1 and n2 are the AST root nodes of the subtrees.
For each different concrete AST node type T there is a
public boolean match(T node, Object other) method
that matches the given node against another object (typically another
AST node, although this is not essential). The default implementations
provided by this class tests whether the other object is a node of the
same type with structurally isomorphic child subtrees. For nodes with
list-valued properties, the child nodes within the list are compared in
order. For nodes with multiple properties, the child nodes are compared
in the order that most closely corresponds to the lexical reading order
of the source program. For instance, for a type declaration node, the
child ordering is: name, superclass, superinterfaces, and body
declarations.
Subclasses may override (extend or reimplement) some or all of the
match methods in order to define more specialized subtree
matchers.
- Since:
- 2.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new AST matcher instance.ASTMatcher(boolean matchDocTags) Creates a new AST matcher instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatch(AnnotationTypeDeclaration node, Object other) Returns whether the given node and the other object match.booleanmatch(AnnotationTypeMemberDeclaration node, Object other) Returns whether the given node and the other object match.booleanmatch(AnonymousClassDeclaration node, Object other) Returns whether the given node and the other object match.booleanmatch(ArrayAccess node, Object other) Returns whether the given node and the other object match.booleanmatch(ArrayCreation node, Object other) Returns whether the given node and the other object object match.booleanmatch(ArrayInitializer node, Object other) Returns whether the given node and the other object match.booleanReturns whether the given node and the other object match.booleanmatch(AssertStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(Assignment node, Object other) Returns whether the given node and the other object match.booleanmatch(BlockComment node, Object other) Returns whether the given node and the other object match.booleanReturns whether the given node and the other object match.booleanmatch(BooleanLiteral node, Object other) Returns whether the given node and the other object match.booleanmatch(BreakStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(CaseDefaultExpression node, Object other) Returns whether the given node and the other object match.booleanmatch(CastExpression node, Object other) Returns whether the given node and the other object match.booleanmatch(CatchClause node, Object other) Returns whether the given node and the other object match.booleanmatch(CharacterLiteral node, Object other) Returns whether the given node and the other object match.booleanmatch(ClassInstanceCreation node, Object other) Returns whether the given node and the other object match.booleanmatch(CompilationUnit node, Object other) Returns whether the given node and the other object match.booleanmatch(ConditionalExpression node, Object other) Returns whether the given node and the other object match.booleanmatch(ConstructorInvocation node, Object other) Returns whether the given node and the other object match.booleanmatch(ContinueStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(CreationReference node, Object other) Returns whether the given node and the other object match.booleanReturns whether the given node and the other object match.booleanmatch(DoStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(EitherOrMultiPattern node, Object other) Returns whether the given node and the other object match.booleanmatch(EmptyStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(EnhancedForStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(EnumConstantDeclaration node, Object other) Returns whether the given node and the other object match.booleanmatch(EnumDeclaration node, Object other) Returns whether the given node and the other object match.booleanmatch(ExportsDirective node, Object other) Returns whether the given node and the other object match.booleanmatch(ExpressionMethodReference node, Object other) Returns whether the given node and the other object match.booleanmatch(ExpressionStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(FieldAccess node, Object other) Returns whether the given node and the other object match.booleanmatch(FieldDeclaration node, Object other) Returns whether the given node and the other object match.booleanmatch(ForStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(GuardedPattern node, Object other) Returns whether the given node and the other object match.booleanmatch(IfStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(ImplicitTypeDeclaration node, Object other) Returns whether the given node and the other object match.booleanmatch(ImportDeclaration node, Object other) Returns whether the given node and the other object match.booleanmatch(InfixExpression node, Object other) Returns whether the given node and the other object match.booleanmatch(Initializer node, Object other) Returns whether the given node and the other object match.booleanmatch(InstanceofExpression node, Object other) Returns whether the given node and the other object match.booleanmatch(IntersectionType node, Object other) Returns whether the given node and the other object match.booleanmatch(JavaDocRegion node, Object other) Returns whether the given node and the other object match.booleanReturns whether the given node and the other object match.booleanmatch(JavaDocTextElement node, Object other) Returns whether the given node and the other object match.booleanmatch(LabeledStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(LambdaExpression node, Object other) Returns whether the given node and the other object match.booleanmatch(LineComment node, Object other) Returns whether the given node and the other object match.booleanmatch(MarkerAnnotation node, Object other) Returns whether the given node and the other object match.booleanReturns whether the given node and the other object match.booleanmatch(MemberValuePair node, Object other) Returns whether the given node and the other object match.booleanmatch(MethodDeclaration node, Object other) Returns whether the given node and the other object match.booleanmatch(MethodInvocation node, Object other) Returns whether the given node and the other object match.booleanmatch(MethodRefParameter node, Object other) Returns whether the given node and the other object match.booleanReturns whether the given node and the other object match.booleanReturns whether the given node and the other object match.booleanmatch(ModuleDeclaration node, Object other) Returns whether the given node and the other object match.booleanmatch(ModuleModifier node, Object other) Returns whether the given node and the other object match.booleanmatch(ModuleQualifiedName node, Object other) Returns whether the given node and the other object match.booleanmatch(NameQualifiedType node, Object other) Returns whether the given node and the other object match.booleanmatch(NormalAnnotation node, Object other) Returns whether the given node and the other object match.booleanmatch(NullLiteral node, Object other) Returns whether the given node and the other object match.booleanmatch(NullPattern node, Object other) Returns whether the given node and the other object match.booleanmatch(NumberLiteral node, Object other) Returns whether the given node and the other object match.booleanmatch(OpensDirective node, Object other) Returns whether the given node and the other object match.booleanmatch(PackageDeclaration node, Object other) Returns whether the given node and the other object match.booleanmatch(ParameterizedType node, Object other) Returns whether the given node and the other object match.booleanmatch(ParenthesizedExpression node, Object other) Returns whether the given node and the other object match.booleanmatch(PatternInstanceofExpression node, Object other) Returns whether the given node and the other object match.booleanmatch(PostfixExpression node, Object other) Returns whether the given node and the other object match.booleanmatch(PrefixExpression node, Object other) Returns whether the given node and the other object match.booleanmatch(PrimitiveType node, Object other) Returns whether the given node and the other object match.booleanmatch(ProvidesDirective node, Object other) Returns whether the given node and the other object match.booleanmatch(QualifiedName node, Object other) Returns whether the given node and the other object match.booleanmatch(QualifiedType node, Object other) Returns whether the given node and the other object match.booleanmatch(RecordDeclaration node, Object other) Returns whether the given node and the other object match.booleanmatch(RecordPattern node, Object other) Returns whether the given node and the other object match.booleanmatch(RequiresDirective node, Object other) Returns whether the given node and the other object match.booleanmatch(ReturnStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(SimpleName node, Object other) Returns whether the given node and the other object match.booleanmatch(SimpleType node, Object other) Returns whether the given node and the other object match.booleanmatch(SingleMemberAnnotation node, Object other) Returns whether the given node and the other object match.booleanmatch(SingleVariableDeclaration node, Object other) Returns whether the given node and the other object match.booleanmatch(StringLiteral node, Object other) Returns whether the given node and the other object match.booleanmatch(SuperConstructorInvocation node, Object other) Returns whether the given node and the other object match.booleanmatch(SuperFieldAccess node, Object other) Returns whether the given node and the other object match.booleanmatch(SuperMethodInvocation node, Object other) Returns whether the given node and the other object match.booleanmatch(SuperMethodReference node, Object other) Returns whether the given node and the other object match.booleanmatch(SwitchCase node, Object other) Returns whether the given node and the other object match.booleanmatch(SwitchExpression node, Object other) Returns whether the given node and the other object match.booleanmatch(SwitchStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(SynchronizedStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(TagElement node, Object other) Returns whether the given node and the other object match.booleanmatch(TagProperty node, Object other) Returns whether the given node and the other object match.booleanReturns whether the given node and the other object match.booleanmatch(TextElement node, Object other) Returns whether the given node and the other object match.booleanmatch(ThisExpression node, Object other) Returns whether the given node and the other object match.booleanmatch(ThrowStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(TryStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(TypeDeclaration node, Object other) Returns whether the given node and the other object match.booleanmatch(TypeDeclarationStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(TypeLiteral node, Object other) Returns whether the given node and the other object match.booleanmatch(TypeMethodReference node, Object other) Returns whether the given node and the other object match.booleanmatch(TypeParameter node, Object other) Returns whether the given node and the other object match.booleanmatch(TypePattern node, Object other) Returns whether the given node and the other object match.booleanReturns whether the given node and the other object match.booleanmatch(UsesDirective node, Object other) Returns whether the given node and the other object match.booleanmatch(VariableDeclarationExpression node, Object other) Returns whether the given node and the other object match.booleanmatch(VariableDeclarationFragment node, Object other) Returns whether the given node and the other object match.booleanmatch(VariableDeclarationStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(WhileStatement node, Object other) Returns whether the given node and the other object match.booleanmatch(WildcardType node, Object other) Returns whether the given node and the other object match.booleanmatch(YieldStatement node, Object other) Returns whether the given node and the other object match.static booleansafeEquals(Object o1, Object o2) Returns whether the given objects are equal according toequals.final booleansafeSubtreeListMatch(List list1, List list2) Returns whether the given lists of AST nodes match pair wise according toASTNode.subtreeMatch.final booleansafeSubtreeMatch(Object node1, Object node2) Returns whether the given nodes match according toAST.subtreeMatch.
-
Constructor Details
-
ASTMatcher
public ASTMatcher()Creates a new AST matcher instance.For backwards compatibility, the matcher ignores tag elements below doc comments by default. Use
ASTMatcher(true)for a matcher that compares doc tags by default. -
ASTMatcher
public ASTMatcher(boolean matchDocTags) Creates a new AST matcher instance.- Parameters:
matchDocTags-trueif doc comment tags are to be compared by default, andfalseotherwise- Since:
- 3.0
- See Also:
-
-
Method Details
-
safeSubtreeListMatch
Returns whether the given lists of AST nodes match pair wise according toASTNode.subtreeMatch.Note that this is a convenience method, useful for writing recursive subtree matchers.
- Parameters:
list1- the first list of AST nodes (element type:ASTNode)list2- the second list of AST nodes (element type:ASTNode)- Returns:
trueif the lists have the same number of elements and match pair-wise according toASTNode.subtreeMatch- See Also:
-
safeSubtreeMatch
Returns whether the given nodes match according toAST.subtreeMatch. Returnsfalseif one or the other of the nodes arenull. Returnstrueif both nodes arenull.Note that this is a convenience method, useful for writing recursive subtree matchers.
- Parameters:
node1- the first AST node, ornull; must be an instance ofASTNodenode2- the second AST node, ornull; must be an instance ofASTNode- Returns:
trueif the nodes match according toAST.subtreeMatchor both arenull, andfalseotherwise- See Also:
-
safeEquals
Returns whether the given objects are equal according toequals. Returnsfalseif either node isnull.- Parameters:
o1- the first object, ornullo2- the second object, ornull- Returns:
trueif the nodes are equal according toequalsor bothnull, andfalseotherwise
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.1
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.1
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type. Subclasses may override this method as needed.
Note:
LineCommentandBlockCommentnodes are not considered part of main structure of the AST. This method will only be called if a client goes out of their way to visit this kind of node explicitly.- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.0
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.28
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.10
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.10
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.1
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.1
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.1
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.14
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.10
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.28
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.10
-
match
Returns whether the given node and the other object match.Unlike other node types, the behavior of the default implementation is controlled by a constructor-supplied parameter
ASTMatcher(boolean)which isfalseif not specified. When this parameter istrue, the implementation tests whether the other object is also aJavadocwith structurally isomorphic child subtrees; the comment string (Javadoc.getComment()) is ignored. Conversely, when the parameter isfalse, the implementation tests whether the other object is also aJavadocwith exactly the same comment string; the tag elements (Javadoc.tagsare ignored. Subclasses may reimplement.- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- See Also:
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.30
- See Also:
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.31
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.10
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type. Subclasses may override this method as needed.
Note:
LineCommentandBlockCommentnodes are not considered part of main structure of the AST. This method will only be called if a client goes out of their way to visit this kind of node explicitly.- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.0
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.1
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.0
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.1
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.0
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.0
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
Note that extra array dimensions are compared since they are an important part of the method declaration.
Note that the method return types are compared even for constructor declarations.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.1
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.14
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.14
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.10
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.1
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.28
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.14
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.1
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.26
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.14
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Restriction:
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.1
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.22
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.32
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.38
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.14
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.1
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
Note that extra array dimensions and the variable arity flag are compared since they are both important parts of the declaration.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.10
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.18
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.0
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.30
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.20
- Restriction:
- This method is not intended to be referenced by clients as it is a part of Java preview feature.
- Restriction:
- This method is not intended to be re-implemented or extended by clients as it is a part of Java preview feature.
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.0
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.10
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.1
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.28
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.7.1
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.14
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
Note that extra array dimensions are compared since they are an important part of the type of the variable.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.1
-
match
Returns whether the given node and the other object match.The default implementation provided by this class tests whether the other object is a node of the same type with structurally isomorphic child subtrees. Subclasses may override this method as needed.
- Parameters:
node- the nodeother- the other object, ornull- Returns:
trueif the subtree matches, orfalseif they do not match or the other object has a different node type or isnull- Since:
- 3.20
- Restriction:
- This method is not intended to be referenced by clients as it is a part of Java preview feature.
- Restriction:
- This method is not intended to be re-implemented or extended by clients as it is a part of Java preview feature.
-
match
Returns whether the given node and the other object match.- Parameters:
node- the node to checkother- the other object- Since:
- 3.38
-