Class CssNode
- All Implemented Interfaces:
Locatable
- Direct Known Subclasses:
CssCombinatorNode,CssDeclarationNode,CssKeyframeRulesetNode,CssKeyNode,CssNodesListNode,CssRefinerNode,CssRootNode,CssRulesetNode,CssSelectorNode,CssValueNode
TODO(oana): Declare this class as: public abstract class CssNode<T extends CssNode> {...}
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCssNode()Constructor of a node.protectedConstructor of a node.protectedCssNode(CssNode parent, SourceCodeLocation sourceCodeLocation) Constructor of a node.protectedCssNode(CssNode parent, List<CssCommentNode> comments, SourceCodeLocation sourceCodeLocation) Constructor of a node.protectedCssNode(SourceCodeLocation sourceCodeLocation) Constructor of a node. -
Method Summary
Modifier and TypeMethodDescriptionThis node and the transitive closure of itsparents.voidappendComment(CssCommentNode comment) abstract CssNodedeepCopy()deepCopyNodes(List<N> nodes) final booleanThis is the default implementation ofequals().booleanbooleanhasComment(String comment) Returns whether one of the comments attached to this node exactly matches the given string.final inthashCode()This is the default implementation ofhashCode().booleanReturns true when any of anode'sancestors()is a function node.voidsetComments(List<CssCommentNode> comments) voidsetShouldBeFlipped(boolean shouldBeFlipped) Marks a node whether it should be flipped or not.voidsetSourceCodeLocation(SourceCodeLocation sourceCodeLocation) toString()This is the default implementation oftoString().
-
Constructor Details
-
CssNode
protected CssNode()Constructor of a node. -
CssNode
Constructor of a node.- Parameters:
sourceCodeLocation- sourceCodeLocation
-
CssNode
Constructor of a node.- Parameters:
parent- parent
-
CssNode
Constructor of a node.- Parameters:
parent- parentsourceCodeLocation- sourceCodeLocation
-
CssNode
protected CssNode(@Nullable CssNode parent, @Nullable List<CssCommentNode> comments, @Nullable SourceCodeLocation sourceCodeLocation) Constructor of a node.- Parameters:
parent- parentcomments- commentssourceCodeLocation- sourceCodeLocation
-
-
Method Details
-
deepCopy
-
getParent
-
getSourceCodeLocation
- Specified by:
getSourceCodeLocationin interfaceLocatable
-
setSourceCodeLocation
-
appendComment
-
setComments
-
getComments
-
hasComment
Returns whether one of the comments attached to this node exactly matches the given string.- Parameters:
comment- comment
-
getShouldBeFlipped
public boolean getShouldBeFlipped() -
setShouldBeFlipped
public void setShouldBeFlipped(boolean shouldBeFlipped) Marks a node whether it should be flipped or not.- Parameters:
shouldBeFlipped- Whether the node should be flipped or not.
-
equals
This is the default implementation ofequals(). The method is markedfinalso that nobody changes the default behavior.The rationale for not allowing redefinition of equals is that different compiler passes and different optimizations have their own notion of equality. In order to avoid confusion and errors everybody that needs a custom definition of equality and custom hash codes should use customized collections with custom comparators or hash code providers.
In addition, this class should not implement
Comparable. UseComparatorinstead. -
hashCode
public final int hashCode()This is the default implementation ofhashCode(). The method is markedfinalso that nobody changes the default behavior. -
toString
This is the default implementation oftoString().Overriding this method should only be done for debugging or logging purposes, not for the actual functionality of the compiler. If a string representation of a tree is needed, define a Visitor that builds the desired representation.
-
ancestors
This node and the transitive closure of itsparents. -
inFunArgs
public boolean inFunArgs()Returns true when any of anode'sancestors()is a function node. -
getVisitController
-
deepCopyNodes
-