- All Known Subinterfaces:
CSSAttrValue
,CSSColorMixFunction
,CSSColorValue
,CSSCountersValue
,CSSCounterValue
,CSSEnvVariableValue
,CSSExpressionValue
,CSSFunctionValue
,CSSGradientValue
,CSSLexicalValue
,CSSMathFunctionValue
,CSSMathValue
,CSSNumberValue
,CSSRatioValue
,CSSTypedValue
,CSSUnicodeRangeValue
,CSSUnicodeRangeValue.CSSUnicodeValue
,CSSVarValue
,HSLColorValue
,HWBColorValue
,LABColorValue
,LCHColorValue
- All Known Implementing Classes:
AttrValue
,CalcValue
,ColorValue
,EnvVariableValue
,ExpressionValue
,FunctionValue
,GradientValue
,HSLColorValue
,HWBColorValue
,IdentifierValue
,LABColorValue
,LCHColorValue
,LexicalValue
,MathFunctionValue
,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 short
If this is aNUMERIC
value, get its unit type.default boolean
Test whether this is a numeric value that is less than zero.default boolean
void
This value is expected to contain an integer.Methods inherited from interface io.sf.carte.doc.style.css.CSSValue
clone, getCssText, getCssValueType, getMinifiedCssText, 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:
true
if this is a numeric value and its value is negative.
-
isPrimitiveValue
default boolean isPrimitiveValue()- Specified by:
isPrimitiveValue
in interfaceCSSValue
- Returns:
true
if the value isTYPED
orPROXY
.
-
getUnitType
default short getUnitType()If this is aNUMERIC
value, get its unit type.You can also find the unit types of mathematical functions and
calc()
expressions, although this may be computationally expensive:- For
calc()
expressions please useCSSMathValue.computeUnitType()
. - For mathematical functions use
CSSMathFunctionValue.computeUnitType()
.
- Returns:
- the unit type as in
CSSUnit
, orCSS_INVALID
if the type is not numeric or the unit is not valid.
- For
-