Class AbstractAutomataChecker

java.lang.Object
org.sonar.java.checks.helpers.AbstractAutomataChecker
Direct Known Subclasses:
IntersectAutomataChecker, SupersetAutomataChecker

public abstract class AbstractAutomataChecker extends Object
  • Field Details

    • defaultAnswer

      protected final boolean defaultAnswer
  • Constructor Details

    • AbstractAutomataChecker

      protected AbstractAutomataChecker(boolean defaultAnswer)
  • Method Details

    • 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)