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
ConstructorDescriptionCreates a new AST matcher instance.ASTMatcher
(boolean matchDocTags) Creates a new AST matcher instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
match
(AnnotationTypeDeclaration node, Object other) Returns whether the given node and the other object match.boolean
match
(AnnotationTypeMemberDeclaration node, Object other) Returns whether the given node and the other object match.boolean
match
(AnonymousClassDeclaration node, Object other) Returns whether the given node and the other object match.boolean
match
(ArrayAccess node, Object other) Returns whether the given node and the other object match.boolean
match
(ArrayCreation node, Object other) Returns whether the given node and the other object object match.boolean
match
(ArrayInitializer node, Object other) Returns whether the given node and the other object match.boolean
Returns whether the given node and the other object match.boolean
match
(AssertStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(Assignment node, Object other) Returns whether the given node and the other object match.boolean
match
(BlockComment node, Object other) Returns whether the given node and the other object match.boolean
Returns whether the given node and the other object match.boolean
match
(BooleanLiteral node, Object other) Returns whether the given node and the other object match.boolean
match
(BreakStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(CaseDefaultExpression node, Object other) Returns whether the given node and the other object match.boolean
match
(CastExpression node, Object other) Returns whether the given node and the other object match.boolean
match
(CatchClause node, Object other) Returns whether the given node and the other object match.boolean
match
(CharacterLiteral node, Object other) Returns whether the given node and the other object match.boolean
match
(ClassInstanceCreation node, Object other) Returns whether the given node and the other object match.boolean
match
(CompilationUnit node, Object other) Returns whether the given node and the other object match.boolean
match
(ConditionalExpression node, Object other) Returns whether the given node and the other object match.boolean
match
(ConstructorInvocation node, Object other) Returns whether the given node and the other object match.boolean
match
(ContinueStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(CreationReference node, Object other) Returns whether the given node and the other object match.boolean
Returns whether the given node and the other object match.boolean
match
(DoStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(EitherOrMultiPattern node, Object other) Returns whether the given node and the other object match.boolean
match
(EmptyStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(EnhancedForStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(EnumConstantDeclaration node, Object other) Returns whether the given node and the other object match.boolean
match
(EnumDeclaration node, Object other) Returns whether the given node and the other object match.boolean
match
(ExportsDirective node, Object other) Returns whether the given node and the other object match.boolean
match
(ExpressionMethodReference node, Object other) Returns whether the given node and the other object match.boolean
match
(ExpressionStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(FieldAccess node, Object other) Returns whether the given node and the other object match.boolean
match
(FieldDeclaration node, Object other) Returns whether the given node and the other object match.boolean
match
(ForStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(GuardedPattern node, Object other) Returns whether the given node and the other object match.boolean
match
(IfStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(ImplicitTypeDeclaration node, Object other) Returns whether the given node and the other object match.boolean
match
(ImportDeclaration node, Object other) Returns whether the given node and the other object match.boolean
match
(InfixExpression node, Object other) Returns whether the given node and the other object match.boolean
match
(Initializer node, Object other) Returns whether the given node and the other object match.boolean
match
(InstanceofExpression node, Object other) Returns whether the given node and the other object match.boolean
match
(IntersectionType node, Object other) Returns whether the given node and the other object match.boolean
match
(JavaDocRegion node, Object other) Returns whether the given node and the other object match.boolean
Returns whether the given node and the other object match.boolean
match
(JavaDocTextElement node, Object other) Returns whether the given node and the other object match.boolean
match
(LabeledStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(LambdaExpression node, Object other) Returns whether the given node and the other object match.boolean
match
(LineComment node, Object other) Returns whether the given node and the other object match.boolean
match
(MarkerAnnotation node, Object other) Returns whether the given node and the other object match.boolean
Returns whether the given node and the other object match.boolean
match
(MemberValuePair node, Object other) Returns whether the given node and the other object match.boolean
match
(MethodDeclaration node, Object other) Returns whether the given node and the other object match.boolean
match
(MethodInvocation node, Object other) Returns whether the given node and the other object match.boolean
match
(MethodRefParameter node, Object other) Returns whether the given node and the other object match.boolean
Returns whether the given node and the other object match.boolean
Returns whether the given node and the other object match.boolean
match
(ModuleDeclaration node, Object other) Returns whether the given node and the other object match.boolean
match
(ModuleModifier node, Object other) Returns whether the given node and the other object match.boolean
match
(ModuleQualifiedName node, Object other) Returns whether the given node and the other object match.boolean
match
(NameQualifiedType node, Object other) Returns whether the given node and the other object match.boolean
match
(NormalAnnotation node, Object other) Returns whether the given node and the other object match.boolean
match
(NullLiteral node, Object other) Returns whether the given node and the other object match.boolean
match
(NullPattern node, Object other) Returns whether the given node and the other object match.boolean
match
(NumberLiteral node, Object other) Returns whether the given node and the other object match.boolean
match
(OpensDirective node, Object other) Returns whether the given node and the other object match.boolean
match
(PackageDeclaration node, Object other) Returns whether the given node and the other object match.boolean
match
(ParameterizedType node, Object other) Returns whether the given node and the other object match.boolean
match
(ParenthesizedExpression node, Object other) Returns whether the given node and the other object match.boolean
match
(PatternInstanceofExpression node, Object other) Returns whether the given node and the other object match.boolean
match
(PostfixExpression node, Object other) Returns whether the given node and the other object match.boolean
match
(PrefixExpression node, Object other) Returns whether the given node and the other object match.boolean
match
(PrimitiveType node, Object other) Returns whether the given node and the other object match.boolean
match
(ProvidesDirective node, Object other) Returns whether the given node and the other object match.boolean
match
(QualifiedName node, Object other) Returns whether the given node and the other object match.boolean
match
(QualifiedType node, Object other) Returns whether the given node and the other object match.boolean
match
(RecordDeclaration node, Object other) Returns whether the given node and the other object match.boolean
match
(RecordPattern node, Object other) Returns whether the given node and the other object match.boolean
match
(RequiresDirective node, Object other) Returns whether the given node and the other object match.boolean
match
(ReturnStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(SimpleName node, Object other) Returns whether the given node and the other object match.boolean
match
(SimpleType node, Object other) Returns whether the given node and the other object match.boolean
match
(SingleMemberAnnotation node, Object other) Returns whether the given node and the other object match.boolean
match
(SingleVariableDeclaration node, Object other) Returns whether the given node and the other object match.boolean
match
(StringFragment node, Object other) Returns whether the given node and the other object match.boolean
match
(StringLiteral node, Object other) Returns whether the given node and the other object match.boolean
match
(StringTemplateComponent node, Object other) Returns whether the given node and the other object match.boolean
match
(StringTemplateExpression node, Object other) Returns whether the given node and the other object match.boolean
match
(SuperConstructorInvocation node, Object other) Returns whether the given node and the other object match.boolean
match
(SuperFieldAccess node, Object other) Returns whether the given node and the other object match.boolean
match
(SuperMethodInvocation node, Object other) Returns whether the given node and the other object match.boolean
match
(SuperMethodReference node, Object other) Returns whether the given node and the other object match.boolean
match
(SwitchCase node, Object other) Returns whether the given node and the other object match.boolean
match
(SwitchExpression node, Object other) Returns whether the given node and the other object match.boolean
match
(SwitchStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(SynchronizedStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(TagElement node, Object other) Returns whether the given node and the other object match.boolean
match
(TagProperty node, Object other) Returns whether the given node and the other object match.boolean
Returns whether the given node and the other object match.boolean
match
(TextElement node, Object other) Returns whether the given node and the other object match.boolean
match
(ThisExpression node, Object other) Returns whether the given node and the other object match.boolean
match
(ThrowStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(TryStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(TypeDeclaration node, Object other) Returns whether the given node and the other object match.boolean
match
(TypeDeclarationStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(TypeLiteral node, Object other) Returns whether the given node and the other object match.boolean
match
(TypeMethodReference node, Object other) Returns whether the given node and the other object match.boolean
match
(TypeParameter node, Object other) Returns whether the given node and the other object match.boolean
match
(TypePattern node, Object other) Returns whether the given node and the other object match.boolean
Returns whether the given node and the other object match.boolean
match
(UsesDirective node, Object other) Returns whether the given node and the other object match.boolean
match
(VariableDeclarationExpression node, Object other) Returns whether the given node and the other object match.boolean
match
(VariableDeclarationFragment node, Object other) Returns whether the given node and the other object match.boolean
match
(VariableDeclarationStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(WhileStatement node, Object other) Returns whether the given node and the other object match.boolean
match
(WildcardType node, Object other) Returns whether the given node and the other object match.boolean
match
(YieldStatement node, Object other) Returns whether the given node and the other object match.static boolean
safeEquals
(Object o1, Object o2) Returns whether the given objects are equal according toequals
.final boolean
safeSubtreeListMatch
(List list1, List list2) Returns whether the given lists of AST nodes match pair wise according toASTNode.subtreeMatch
.final boolean
safeSubtreeMatch
(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
-true
if doc comment tags are to be compared by default, andfalse
otherwise- 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:
true
if 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
. Returnsfalse
if one or the other of the nodes arenull
. Returnstrue
if 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 ofASTNode
node2
- the second AST node, ornull
; must be an instance ofASTNode
- Returns:
true
if the nodes match according toAST.subtreeMatch
or both arenull
, andfalse
otherwise- See Also:
-
safeEquals
Returns whether the given objects are equal according toequals
. Returnsfalse
if either node isnull
.- Parameters:
o1
- the first object, ornull
o2
- the second object, ornull
- Returns:
true
if the nodes are equal according toequals
or bothnull
, andfalse
otherwise
-
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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
LineComment
andBlockComment
nodes 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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 isfalse
if not specified. When this parameter istrue
, the implementation tests whether the other object is also aJavadoc
with 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 aJavadoc
with exactly the same comment string; the tag elements (Javadoc.tags
are ignored. Subclasses may reimplement.- Parameters:
node
- the nodeother
- the other object, ornull
- Returns:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
LineComment
andBlockComment
nodes 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if 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:
true
if the subtree matches, orfalse
if they do not match or the other object has a different node type or isnull
- Since:
- 3.37
- Restriction:
- This method is not intended to be referenced 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:
true
if the subtree matches, orfalse
if they do not match or the other object has a different node type or isnull
- Since:
- 3.37
-
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:
true
if the subtree matches, orfalse
if they do not match or the other object has a different node type or isnull
- Since:
- 3.37
-
match
Returns whether the given node and the other object match.- Parameters:
node
- the node to checkother
- the other object- Since:
- 3.38
-