- All Known Subinterfaces:
CSSColorMixFunction,CSSColorValue,CSSCountersValue,CSSCounterValue,CSSEnvVariableValue,CSSExpressionValue,CSSFunctionValue,CSSGradientValue,CSSLexicalValue,CSSMathFunctionValue,CSSMathValue,CSSNumberValue,CSSRatioValue,CSSTransformFunction,CSSTypedValue,CSSUnicodeRangeValue,CSSUnicodeRangeValue.CSSUnicodeValue,CSSVarValue,HSLColorValue,HWBColorValue,LABColorValue,LCHColorValue
- All Known Implementing Classes:
CalcValue,ColorValue,EnvVariableValue,ExpressionValue,FunctionValue,GradientValue,HSLColorValue,HWBColorValue,IdentifierValue,LABColorValue,LCHColorValue,LexicalValue,MathFunctionValue,NumberValue,PercentageValue,PrimitiveValue,ProxyValue,RatioValue,RectValue,RGBColorValue,StringValue,SystemDefaultValue,TransformFunction,TypedValue,UnicodeRangeValue,UnicodeValue,UnicodeWildcardValue,UnknownValue,URIValue,URIValueWrapper
-
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 aNUMERICvalue, get its unit type.default booleanTest whether this is a numeric value that is less than zero.default booleanvoidThis value is expected to contain an integer.Methods inherited from interface io.sf.carte.doc.style.css.CSSValue
clone, getCssText, getCssValueType, getMinifiedCssText, getMinifiedCssText, getPrecedingComments, getPrimitiveType, getTrailingComments, 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.
-
isPrimitiveValue
default boolean isPrimitiveValue()- Specified by:
isPrimitiveValuein interfaceCSSValue- Returns:
trueif the value isTYPEDorPROXY.
-
getUnitType
default short getUnitType()If this is aNUMERICvalue, 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_INVALIDif the type is not numeric or the unit is not valid.
- For
-