Package io.sf.carte.doc.style.css
Interface CSSExpression
- All Known Subinterfaces:
AlgebraicExpression
,CSSOperandExpression
public interface CSSExpression
Implemented by CSS expressions. See
CSS Values and Units Module
Level 3: Mathematical Expressions
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Enumeration of expression parts (operations, operands). -
Method Summary
Modifier and TypeMethodDescriptionclone()
Create and return a copy of this object.Get a string representation of the expression.Get a minified string representation of the expression.Get the parent expression.Get the type ofCSSExpression.AlgebraicPart
.boolean
Is this an inverse operation ?void
writeCssText
(io.sf.carte.util.SimpleWriter wri) Serialize this expression to aSimpleWriter
.
-
Method Details
-
getCssText
String getCssText()Get a string representation of the expression.- Returns:
- a string representation of the expression.
-
getMinifiedCssText
String getMinifiedCssText()Get a minified string representation of the expression.- Returns:
- a minified string representation of the expression.
-
writeCssText
Serialize this expression to aSimpleWriter
.- Parameters:
wri
- the SimpleWriter.- Throws:
IOException
- if an error happened while writing.
-
getParentExpression
CSSExpression getParentExpression()Get the parent expression. In a nested expression, the outer expression is the parent.
For example, in
a * (b + c)
, being the sum(b + c)
this expression, its parent would be the product bya
.- Returns:
- the parent expression,
null
if none (this is root expression).
-
isInverseOperation
boolean isInverseOperation()Is this an inverse operation ?If there is a containing operation, the inverse is from the point of view of the parent operation. In a sum (or a product contained inside a sum), the inverse means that the minus sign applies to the whole operation. In a product it is a division.
- Returns:
true
if the operation is inverse.
-
getPartType
CSSExpression.AlgebraicPart getPartType()Get the type ofCSSExpression.AlgebraicPart
.- Returns:
- the type of part (operation, operand).
-
clone
CSSExpression clone()Create and return a copy of this object.- Returns:
- a copy of this object.
-