Package io.sf.carte.doc.style.css
Interface CSSPrimitiveValue
- All Known Subinterfaces:
CSSAttrValue,CSSColorValue,CSSCountersValue,CSSCounterValue,CSSEnvVariableValue,CSSExpressionValue,CSSFunctionValue,CSSGradientValue,CSSLexicalValue,CSSRatioValue,CSSTypedValue,CSSUnicodeRangeValue,CSSUnicodeRangeValue.CSSUnicodeValue,CSSVarValue,HSLColorValue,HWBColorValue,LABColorValue,LCHColorValue,RGBColorValue
- All Known Implementing Classes:
AttrValue,CalcValue,ColorValue,EnvVariableValue,ExpressionValue,FunctionValue,GradientValue,HSLColorValue,HWBColorValue,IdentifierValue,LABColorValue,LCHColorValue,LexicalValue,NumberValue,PercentageValue,PrimitiveValue,ProxyValue,RatioValue,RectValue,RGBColorValue,StringValue,SystemDefaultValue,TypedValue,UnicodeRangeValue,UnicodeValue,UnicodeWildcardValue,UnknownValue,URIValue,URIValueWrapper,VarValue
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.sf.carte.doc.style.css.CSSValue
CSSValue.CssType, CSSValue.Type -
Method Summary
Modifier and TypeMethodDescriptiondefault shortIf this is a numeric value, get its unit type.default booleanTest whether this is a numeric value that is less than zero.voidThis value is expected to contain an integer.Methods inherited from interface io.sf.carte.doc.style.css.CSSValue
clone, getCssText, getCssValueType, getMinifiedCssText, getPrimitiveType, matches, setCssText, writeCssText
-
Method Details
-
setExpectInteger
This value is expected to contain an integer.If this value is a non-integer number, an exception will be thrown immediately.
If this value is a
calc()that ever produces a non-integer number, the value shall be rounded to the nearest integer.If the value is a proxy that ever produces other than an integer number (without
calc()involvement), an exception should be thrown later.- Throws:
DOMException- TYPE_MISMATCH_ERR if the value is a constant number and not an integer.
-
isNegativeNumber
default boolean isNegativeNumber()Test whether this is a numeric value that is less than zero.- Returns:
trueif this is a numeric value and its value is negative.
-
getUnitType
default short getUnitType()If this is a numeric value, get its unit type.- Returns:
- the unit type,
CSS_INVALIDif the unit or type are not valid.
-