Package org.sonar.java.checks.helpers
Class AbstractAutomataChecker
- java.lang.Object
-
- org.sonar.java.checks.helpers.AbstractAutomataChecker
-
- Direct Known Subclasses:
IntersectAutomataChecker,SupersetAutomataChecker
public abstract class AbstractAutomataChecker extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandefaultAnswer
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractAutomataChecker(boolean defaultAnswer)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancheck(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)voidclearCache()protected abstract booleanneutralAnswer()The answer that should be returned when running into a cycle in the automaton.
-
-
-
Method Detail
-
check
public boolean check(SubAutomaton auto1, SubAutomaton auto2)
-
check
protected boolean check(SubAutomaton auto1, SubAutomaton auto2, boolean hasConsumedInput)
-
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)
-
-