Class TopAtom

    • Field Detail

      • STRING

        public static final java.lang.String STRING
        The string used to represent this regular expression.
        See Also:
        Constant Field Values
      • INSTANCE

        public static final TopAtom INSTANCE
        The singleton instance.
    • Method Detail

      • toAutomaton

        public <A extends Automaton<A,​T>,​T extends TransitionSymbol<T>> A toAutomaton​(AutomataFactory<A,​T> factory)
        Description copied from class: RegularExpression
        Transforms this regular expression into its equivalent automaton.
        Overrides:
        toAutomaton in class Atom
        Type Parameters:
        A - the concrete type of Automaton that this method yields
        T - the concrete type of TransitionSymbols that instances of A have on their transitions
        Parameters:
        factory - the factory that can be used to create the automaton
        Returns:
        the automaton
      • substringAux

        protected java.util.Set<RegularExpression.PartialSubstring> substringAux​(int charsToSkip,
                                                                                 int missingChars)
        Description copied from class: RegularExpression
        Returns the set of all possible substrings of this regular expression, starting at the given index (inclusive) and ending at the given index (exclusive). Each substring is decorated with the number of characters that are still missing to reach the beginning of the substring, and the number of characters that still need to be added to the string to reach the desired length.
        Overrides:
        substringAux in class Atom
        Parameters:
        charsToSkip - the number of characters to skip before starting to collect the substring
        missingChars - the number of missing characters to complete the substring
        Returns:
        the set of partial substrings
      • isEmpty

        public boolean isEmpty()
        Description copied from class: RegularExpression
        Yields true if and only if this regular expression corresponds to the empty string or to no strings at all.
        Overrides:
        isEmpty in class Atom
        Returns:
        true if that condition holds
      • is

        public boolean is​(java.lang.String str)
        Description copied from class: RegularExpression
        Yields true if and only if this regular expression corresponds to the given string.
        Overrides:
        is in class Atom
        Parameters:
        str - the string
        Returns:
        true if that condition holds
      • mayContain

        public boolean mayContain​(java.lang.String s)
        Description copied from class: RegularExpression
        Yields true if and only if this regular expression may contain the given string.
        Overrides:
        mayContain in class Atom
        Parameters:
        s - the string
        Returns:
        true if that condition holds
      • contains

        public boolean contains​(java.lang.String s)
        Description copied from class: RegularExpression
        Yields true if and only if this regular expression always contains the given string.
        Overrides:
        contains in class Atom
        Parameters:
        s - the string
        Returns:
        true if that condition holds
      • mayStartWith

        public boolean mayStartWith​(java.lang.String s)
        Description copied from class: RegularExpression
        Yields true if and only if this regular expression may start with the given string.
        Overrides:
        mayStartWith in class Atom
        Parameters:
        s - the string
        Returns:
        true if that condition holds
      • startsWith

        public boolean startsWith​(java.lang.String s)
        Description copied from class: RegularExpression
        Yields true if and only if this regular expression always starts with the given string.
        Overrides:
        startsWith in class Atom
        Parameters:
        s - the string
        Returns:
        true if that condition holds
      • mayEndWith

        public boolean mayEndWith​(java.lang.String s)
        Description copied from class: RegularExpression
        Yields true if and only if this regular expression may end with the given string.
        Overrides:
        mayEndWith in class Atom
        Parameters:
        s - the string
        Returns:
        true if that condition holds
      • endsWith

        public boolean endsWith​(java.lang.String s)
        Description copied from class: RegularExpression
        Yields true if and only if this regular expression always ends with the given string.
        Overrides:
        endsWith in class Atom
        Parameters:
        s - the string
        Returns:
        true if that condition holds
      • topAsSingleChar

        protected RegularExpression topAsSingleChar()
        Description copied from class: RegularExpression
        Yields a new regular expression where all TopAtom are assumed to have length one.
        Overrides:
        topAsSingleChar in class Atom
        Returns:
        the regular expression with shrinked top regular expressions
      • topAsEmptyString

        protected RegularExpression topAsEmptyString()
        Description copied from class: RegularExpression
        Yields a new regular expression where all TopAtom are assumed to have length zero.
        Overrides:
        topAsEmptyString in class Atom
        Returns:
        the regular expression with empty top regular expressions
      • explode

        public RegularExpression[] explode()
        Description copied from class: RegularExpression
        Yields a new regular expression that is the exploded version of this one, that is, where all atoms have been broken down to the composition of the characters that compose their inner strings.
        Overrides:
        explode in class Atom
        Returns:
        the exploded regular expression