Package spoon.support.visitor.equals
Class EqualsVisitor
java.lang.Object
spoon.reflect.visitor.CtAbstractVisitor
spoon.reflect.visitor.CtAbstractBiScanner
spoon.reflect.visitor.CtBiScannerDefault
spoon.support.visitor.equals.EqualsVisitor
- All Implemented Interfaces:
CtVisitor
Used to check equality between an element and another one.
-
Field Summary
Modifier and TypeFieldDescriptionprotected EqualsChecker
protected boolean
protected Object
protected Object
protected CtRole
Fields inherited from class spoon.reflect.visitor.CtBiScannerDefault
stack
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
This method is called to compare `element` and `other` when traversing two trees in parallel.protected void
biScan(CtRole role, Collection<? extends CtElement> elements, Collection<? extends CtElement> others)
void
This method is called to compare `element` and `other` according to the role when traversing two trees in parallel.boolean
checkEquals(CtElement element, CtElement other)
protected void
static boolean
protected boolean
boolean
isEqual()
Methods inherited from class spoon.reflect.visitor.CtBiScannerDefault
exit, visitCtAnnotation, visitCtAnnotationFieldAccess, visitCtAnnotationMethod, visitCtAnnotationType, visitCtAnonymousExecutable, visitCtArrayRead, visitCtArrayTypeReference, visitCtArrayWrite, visitCtAssert, visitCtAssignment, visitCtBinaryOperator, visitCtBlock, visitCtBreak, visitCtCase, visitCtCatch, visitCtCatchVariable, visitCtCatchVariableReference, visitCtClass, visitCtCodeSnippetExpression, visitCtCodeSnippetStatement, visitCtComment, visitCtCompilationUnit, visitCtConditional, visitCtConstructor, visitCtConstructorCall, visitCtContinue, visitCtDo, visitCtEnum, visitCtEnumValue, visitCtExecutableReference, visitCtExecutableReferenceExpression, visitCtField, visitCtFieldRead, visitCtFieldReference, visitCtFieldWrite, visitCtFor, visitCtForEach, visitCtIf, visitCtImport, visitCtInterface, visitCtIntersectionTypeReference, visitCtInvocation, visitCtJavaDoc, visitCtJavaDocTag, visitCtLambda, visitCtLiteral, visitCtLocalVariable, visitCtLocalVariableReference, visitCtMethod, visitCtModule, visitCtModuleReference, visitCtModuleRequirement, visitCtNewArray, visitCtNewClass, visitCtOperatorAssignment, visitCtPackage, visitCtPackageDeclaration, visitCtPackageExport, visitCtPackageReference, visitCtParameter, visitCtParameterReference, visitCtProvidedService, visitCtRecord, visitCtRecordComponent, visitCtReturn, visitCtStatementList, visitCtSuperAccess, visitCtSwitch, visitCtSwitchExpression, visitCtSynchronized, visitCtTextBlock, visitCtThisAccess, visitCtThrow, visitCtTry, visitCtTryWithResource, visitCtTypeAccess, visitCtTypeMemberWildcardImportReference, visitCtTypeParameter, visitCtTypeParameterReference, visitCtTypePattern, visitCtTypeReference, visitCtUnaryOperator, visitCtUnboundVariableReference, visitCtUsedService, visitCtVariableRead, visitCtVariableWrite, visitCtWhile, visitCtWildcardReference, visitCtYieldStatement
-
Field Details
-
checker
-
isNotEqual
protected boolean isNotEqual -
notEqualRole
-
notEqualElement
-
notEqualOther
-
-
Constructor Details
-
EqualsVisitor
public EqualsVisitor() -
EqualsVisitor
-
-
Method Details
-
equals
-
enter
- Overrides:
enter
in classCtBiScannerDefault
-
biScan
protected void biScan(CtRole role, Collection<? extends CtElement> elements, Collection<? extends CtElement> others)- Overrides:
biScan
in classCtBiScannerDefault
-
biScan
Description copied from class:CtAbstractBiScanner
This method is called to compare `element` and `other` when traversing two trees in parallel.- Overrides:
biScan
in classCtBiScannerDefault
-
biScan
Description copied from class:CtAbstractBiScanner
This method is called to compare `element` and `other` according to the role when traversing two trees in parallel.- Overrides:
biScan
in classCtBiScannerDefault
-
fail
-
checkEquals
- Parameters:
element
- first to be compared elementother
- second to be compared element- Returns:
- true if `element` and `other` are equal. If false then see
getNotEqualElement()
,getNotEqualOther()
andgetNotEqualRole()
for details
-
isEqual
public boolean isEqual()- Returns:
- true if
checkEquals(CtElement, CtElement)
are equal. If false then seegetNotEqualElement()
,getNotEqualOther()
andgetNotEqualRole()
for details
-
getNotEqualRole
- Returns:
- role on which the element and other element were not equal
-
getNotEqualElement
- Returns:
- element or collection which was not equal
-
getNotEqualOther
- Returns:
- other element or collection which was not equal
-