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
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 Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCssNodesListNode(boolean isEnclosedWithBraces) Constructor of a list of nodes alike.protectedCssNodesListNode(boolean isEnclosedWithBraces, List<CssCommentNode> comments) Constructor of a list of nodes alike.protectedCssNodesListNode(boolean isEnclosedWithBraces, List<T> childrenList, List<CssCommentNode> comments) Constructor of a list of nodes alike.protectedCssNodesListNode(CssNodesListNode<? extends CssNode> node) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildToBack(T child) getChildAt(int index) booleanisEmpty()booleanintvoidreplaceChildAt(int index, List<? extends T> newChildren) toString()For debugging only.Methods inherited from class com.google.common.css.compiler.ast.CssNode
ancestors, appendComment, deepCopy, deepCopyNodes, equals, getComments, getParent, getShouldBeFlipped, getVisitController, hasComment, hashCode, inFunArgs, setComments, setShouldBeFlipped, setSourceCodeLocation
-
Field Details
-
children
-
-
Constructor Details
-
CssNodesListNode
protected CssNodesListNode(boolean isEnclosedWithBraces) Constructor of a list of nodes alike.- Parameters:
isEnclosedWithBraces-
-
CssNodesListNode
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
Copy constructor.- Parameters:
node-
-
-
Method Details
-
getChildren
-
getChildIterator
-
childIterable
-
replaceChildAt
-
getChildAt
-
numChildren
public int numChildren() -
getLastChild
-
addChildToBack
-
isEmpty
public boolean isEmpty() -
isEnclosedWithBraces
public boolean isEnclosedWithBraces() -
toString
For debugging only. -
getSourceCodeLocation
- Specified by:
getSourceCodeLocationin interfaceLocatable- Overrides:
getSourceCodeLocationin classCssNode
-