Package org.sonar.java.checks.helpers
Class AbstractAutomataChecker
java.lang.Object
org.sonar.java.checks.helpers.AbstractAutomataChecker
- Direct Known Subclasses:
IntersectAutomataChecker,SupersetAutomataChecker
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheck(SubAutomaton auto1, SubAutomaton auto2) protected booleancheck(SubAutomaton auto1, SubAutomaton auto2, boolean hasConsumedInput) protected abstract booleancheckAuto1AndAuto2Successors(SubAutomaton auto1, SubAutomaton auto2, boolean defaultAnswer, boolean hasConsumedInput) protected abstract booleancheckAuto1Successors(SubAutomaton auto1, SubAutomaton auto2, boolean defaultAnswer, boolean hasConsumedInput) protected abstract booleancheckAuto2Successors(SubAutomaton auto1, SubAutomaton auto2, boolean defaultAnswer, boolean hasConsumedInput) voidprotected abstract booleanThe answer that should be returned when running into a cycle in the automaton.
-
Field Details
-
defaultAnswer
protected final boolean defaultAnswer
-
-
Constructor Details
-
AbstractAutomataChecker
protected AbstractAutomataChecker(boolean defaultAnswer)
-
-
Method Details
-
check
-
check
-
clearCache
public void clearCache() -
neutralAnswer
protected abstract boolean neutralAnswer()The answer that should be returned when running into a cycle in the automaton. This should be the neutral element with respect to the operation that's used to combine the results from multiple paths. That is, if there are multiple paths, one of whom is part of a cycle whereas the others are not, then the end result should just depend on the non-cyclic paths. Thus if the results are combined with "any", the neutral element should be false and for "all" it should be true. -
checkAuto1AndAuto2Successors
protected abstract boolean checkAuto1AndAuto2Successors(SubAutomaton auto1, SubAutomaton auto2, boolean defaultAnswer, boolean hasConsumedInput) -
checkAuto1Successors
protected abstract boolean checkAuto1Successors(SubAutomaton auto1, SubAutomaton auto2, boolean defaultAnswer, boolean hasConsumedInput) -
checkAuto2Successors
protected abstract boolean checkAuto2Successors(SubAutomaton auto1, SubAutomaton auto2, boolean defaultAnswer, boolean hasConsumedInput)
-