Class Star

    • Constructor Detail

      • Star

        public Star​(RegularExpression op)
        Builds the star.
        Parameters:
        op - the inner regular expression
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getOperand

        public RegularExpression getOperand()
        Yields the inner regular expression.
        Returns:
        the inner regular expression
      • simplify

        public RegularExpression simplify()
        Description copied from class: RegularExpression
        Yields a simplified version of this regular expression. Simplification happens through heuristics.
        Specified by:
        simplify in class RegularExpression
        Returns:
        a simplified regular expression equivalent to this
      • 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.
        Specified by:
        toAutomaton in class RegularExpression
        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

        public 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.
        Specified by:
        substringAux in class RegularExpression
        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.
        Specified by:
        isEmpty in class RegularExpression
        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.
        Specified by:
        is in class RegularExpression
        Parameters:
        str - the string
        Returns:
        true if that condition holds
      • maxLength

        public int maxLength()
        Description copied from interface: TransitionSymbol
        Yields the maximum length of this symbol.
        Returns:
        the maximum length
      • minLength

        public int minLength()
        Description copied from interface: TransitionSymbol
        Yields the minimum length of this symbol.
        Returns:
        the minimum length
      • 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.
        Specified by:
        mayContain in class RegularExpression
        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.
        Specified by:
        contains in class RegularExpression
        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.
        Specified by:
        mayStartWith in class RegularExpression
        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.
        Specified by:
        startsWith in class RegularExpression
        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.
        Specified by:
        mayEndWith in class RegularExpression
        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.
        Specified by:
        endsWith in class RegularExpression
        Parameters:
        s - the string
        Returns:
        true if that condition holds
      • unrollStarToFixedLength

        protected RegularExpression unrollStarToFixedLength​(int length)
        Description copied from class: RegularExpression
        Yields a new regular expression where all Star have been unrolled to a sequence of their inner regular expression of length length.
        Specified by:
        unrollStarToFixedLength in class RegularExpression
        Parameters:
        length - the length
        Returns:
        the regular expression with unrolled stars
      • reverse

        public RegularExpression reverse()
        Description copied from interface: TransitionSymbol
        Yields a new symbol that corresponds to this one, but read back-to-front.
        Returns:
        the reversed symbol
      • 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.
        Specified by:
        explode in class RegularExpression
        Returns:
        the exploded regular expression
      • repeat

        public RegularExpression repeat​(long n)
        Description copied from class: RegularExpression
        Yields a new regular expression corresponding to the n-repetition of this.
        Specified by:
        repeat in class RegularExpression
        Parameters:
        n - number of repetitions
        Returns:
        a new regular expression corresponding to the n-repetition of this
      • trimLeft

        public RegularExpression trimLeft()
        Description copied from class: RegularExpression
        Yields a new regular expression where leading whitespaces have been removed from this.
        Specified by:
        trimLeft in class RegularExpression
        Returns:
        a new regular expression where leading whitespaces have been removed from this
      • trimRight

        public RegularExpression trimRight()
        Description copied from class: RegularExpression
        Yields a new regular expression where trailing whitespaces have been removed from this.
        Specified by:
        trimRight in class RegularExpression
        Returns:
        a new regular expression where trailing whitespaces have been removed from this
      • readsWhiteSpaceString

        protected boolean readsWhiteSpaceString()
        Description copied from class: RegularExpression
        Checks whether this regular expression recognize a string made just of whitespaces.
        Specified by:
        readsWhiteSpaceString in class RegularExpression
        Returns:
        true if this regular expression recognize a string made just of whitespaces, false otherwise.