Class CssNodesListNode<T extends CssNode>

java.lang.Object
com.google.common.css.compiler.ast.CssNode
com.google.common.css.compiler.ast.CssNodesListNode<T>
Type Parameters:
T - the list is restricted to nodes of this type
All Implemented Interfaces:
Locatable
Direct Known Subclasses:
CssAbstractBlockNode, CssAtRuleNode, CssConditionalBlockNode, CssFunctionArgumentsNode, CssImportBlockNode, CssKeyListNode, CssPropertyValueNode, CssRefinerListNode, CssSelectorListNode

public abstract class CssNodesListNode<T extends CssNode> extends CssNode
Represents a list of nodes. This is meant to represent a succession of statements that logically group together as one node in the tree. Examples include:
  • all the statements in a stylesheet, except for the ones that can only appear on top (charset, import, etc.)
  • all the declarations inside a ruleset, a font face or a page rule
  • all the nodes that form a chain of if-elseif-else rules
  • the block that belongs to some of the at rules, such as media
  • Field Details

  • Constructor Details

    • CssNodesListNode

      protected CssNodesListNode(boolean isEnclosedWithBraces)
      Constructor of a list of nodes alike.
      Parameters:
      isEnclosedWithBraces -
    • CssNodesListNode

      protected CssNodesListNode(boolean isEnclosedWithBraces, @Nullable List<CssCommentNode> comments)
      Constructor of a list of nodes alike.
      Parameters:
      isEnclosedWithBraces -
      comments -
    • CssNodesListNode

      protected CssNodesListNode(boolean isEnclosedWithBraces, List<T> childrenList, @Nullable List<CssCommentNode> comments)
      Constructor of a list of nodes alike.
      Parameters:
      isEnclosedWithBraces -
      comments -
      childrenList - list of children
    • CssNodesListNode

      protected CssNodesListNode(CssNodesListNode<? extends CssNode> node)
      Copy constructor.
      Parameters:
      node -
  • Method Details

    • getChildren

      public List<T> getChildren()
    • getChildIterator

      public Iterator<T> getChildIterator()
    • childIterable

      public Iterable<T> childIterable()
    • replaceChildAt

      public void replaceChildAt(int index, List<? extends T> newChildren)
    • getChildAt

      public T getChildAt(int index)
    • numChildren

      public int numChildren()
    • getLastChild

      public T getLastChild()
    • addChildToBack

      public void addChildToBack(T child)
    • isEmpty

      public boolean isEmpty()
    • isEnclosedWithBraces

      public boolean isEnclosedWithBraces()
    • toString

      public String toString()
      For debugging only.
      Overrides:
      toString in class CssNode
      See Also:
    • getSourceCodeLocation

      public SourceCodeLocation getSourceCodeLocation()
      Specified by:
      getSourceCodeLocation in interface Locatable
      Overrides:
      getSourceCodeLocation in class CssNode