Class IndexFinder


  • public class IndexFinder
    extends java.lang.Object
    An algorithm that finds all possible indexes of the first occurrences of an automaton into another one.
    • Constructor Summary

      Constructors 
      Constructor Description
      IndexFinder()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.commons.lang3.tuple.Pair<java.lang.Integer,​java.lang.Integer> findIndexesOf​(RegexAutomaton automaton, RegexAutomaton search)
      Yields the minimum and maximum indexes where search first appears in automaton.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IndexFinder

        public IndexFinder()
    • Method Detail

      • findIndexesOf

        public static org.apache.commons.lang3.tuple.Pair<java.lang.Integer,​java.lang.Integer> findIndexesOf​(RegexAutomaton automaton,
                                                                                                                   RegexAutomaton search)
                                                                                                            throws it.unive.lisa.util.datastructures.automaton.CyclicAutomatonException
        Yields the minimum and maximum indexes where search first appears in automaton. If the second element of the returned pair is null, it means infinity, that is, there is at least a top transition or a loop preceding one of the first matches.

        Note that, if search accepts the empty string, the returned pair will be 0, automaton.maxLengthString(), or 0, null if automaton is not finite.
        Parameters:
        automaton - the automaton
        search - the automaton to search
        Returns:
        a pair of integers, representing the minimum and maximum indexes where search first appears in automaton, or null to represent infinity
        Throws:
        it.unive.lisa.util.datastructures.automaton.CyclicAutomatonException - if search contains a loop