Class SelectorsGroup

  • All Implemented Interfaces:
    Serializable

    public class SelectorsGroup
    extends Selector
    Abstract super class for CSS Selectors. The Token class, which this class inherits from, has line, col, and tokenType fields.
    Author:
    nhant01, GeorgeLuo
    See Also:
    Serialized Form
    • Constructor Detail

      • SelectorsGroup

        public SelectorsGroup​(@Nonnull
                              ArrayDeque<Selector> elements)
        Parameters:
        elements - array of selectors
    • Method Detail

      • forEachChild

        public void forEachChild​(Consumer<Selector> lambda)
        method to run lambda on all elements
        Specified by:
        forEachChild in class Selector
        Parameters:
        lambda - function to executed
      • accept

        public void accept​(@Nonnull
                           SelectorVisitor visitor)
        visits a selector
        Specified by:
        accept in class Selector
        Parameters:
        visitor - a SelectorVisitor instance
      • getTokenType

        public TokenType getTokenType()
        Description copied from class: Token
        Overwrite from children class to get token type
        Specified by:
        getTokenType in class Token
        Returns:
        the type of the token.
      • getElements

        public ArrayDeque<Selector> getElements()
        getter for elements
        Returns:
        this' elements