java.lang.Object
io.sf.carte.doc.style.css.property.StyleValue
io.sf.carte.doc.style.css.property.PrimitiveValue
- All Implemented Interfaces:
- CSSPrimitiveValue2,- ExtendedCSSPrimitiveValue,- ExtendedCSSValue,- Cloneable,- CSSPrimitiveValue,- CSSValue
- Direct Known Subclasses:
- AttrValue,- ColorValue,- CustomPropertyValue,- EnvVariableValue,- ExpressionValue,- FunctionValue,- IdentifierValue,- NumberValue,- RatioValue,- StringValue,- SystemDefaultValue,- UnicodeRangeValue,- UnicodeValue,- UnicodeWildcardValue,- UnknownValue
Base implementation for CSS primitive values.
- 
Field SummaryFields inherited from interface org.w3c.dom.css.CSSPrimitiveValueCSS_ATTR, CSS_CM, CSS_COUNTER, CSS_DEG, CSS_DIMENSION, CSS_EMS, CSS_EXS, CSS_GRAD, CSS_HZ, CSS_IDENT, CSS_IN, CSS_KHZ, CSS_MM, CSS_MS, CSS_NUMBER, CSS_PC, CSS_PERCENTAGE, CSS_PT, CSS_PX, CSS_RAD, CSS_RECT, CSS_RGBCOLOR, CSS_S, CSS_STRING, CSS_UNKNOWN, CSS_URIFields inherited from interface io.sf.carte.doc.style.css.CSSPrimitiveValue2CSS_CAP, CSS_CH, CSS_COUNTERS, CSS_CUSTOM_PROPERTY, CSS_DPCM, CSS_DPI, CSS_DPPX, CSS_ELEMENT_REFERENCE, CSS_ENV_VAR, CSS_EXPRESSION, CSS_FR, CSS_FUNCTION, CSS_GRADIENT, CSS_IC, CSS_LH, CSS_QUARTER_MM, CSS_RATIO, CSS_REM, CSS_RLH, CSS_TURN, CSS_UNICODE_CHARACTER, CSS_UNICODE_RANGE, CSS_UNICODE_WILDCARD, CSS_VB, CSS_VH, CSS_VI, CSS_VMAX, CSS_VMIN, CSS_VWFields inherited from interface org.w3c.dom.css.CSSValueCSS_CUSTOM, CSS_INHERIT, CSS_PRIMITIVE_VALUE, CSS_VALUE_LIST
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedprotectedPrimitiveValue(short unitType) protectedPrimitiveValue(PrimitiveValue copied) 
- 
Method SummaryModifier and TypeMethodDescriptionabstract PrimitiveValueclone()Creates and returns a copy of this object.booleanfloatgetFloatValue(short unitType) This method is used to get a float value in a specified unit.shortGet the RGBA color.inthashCode()booleanTest whether this is a numeric value that was the result of acalc()expression.booleanTest whether this is a numeric value that is less than zero.booleanIs this value a number set to a value of zero, or an absolute value less than 1e-5 ?booleanIs this a subproperty that has been set by a shorthand?voidvoidsetFloatValue(short unitType, float floatValue) voidsetStringValue(short stringType, String stringValue) voidsetSubproperty(boolean subp) Methods inherited from class io.sf.carte.doc.style.css.property.StyleValuegetCssText, getCssValueType, getMinifiedCssText, isSystemDefault, setCssText, toStringMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.w3c.dom.css.CSSValuegetCssText, getCssValueType, setCssTextMethods inherited from interface io.sf.carte.doc.style.css.ExtendedCSSValuegetMinifiedCssText, writeCssText
- 
Constructor Details- 
PrimitiveValueprotected PrimitiveValue(short unitType) 
- 
PrimitiveValueprotected PrimitiveValue()
- 
PrimitiveValue
 
- 
- 
Method Details- 
getPrimitiveTypepublic short getPrimitiveType()- Specified by:
- getPrimitiveTypein interface- CSSPrimitiveValue
 
- 
setFloatValue- Specified by:
- setFloatValuein interface- CSSPrimitiveValue
- Throws:
- DOMException
 
- 
getFloatValueThis method is used to get a float value in a specified unit. If this CSS value doesn't contain a float value or can't be converted into the specified unit, aDOMExceptionis raised.- Specified by:
- getFloatValuein interface- CSSPrimitiveValue
- Parameters:
- unitType- A unit code to get the float value. The unit code can only be a float unit type (i.e.- CSS_NUMBER,- CSS_PERCENTAGE,- CSS_EMS,- CSS_EXS,- CSS_PX,- CSS_CM,- CSS_MM,- CSS_IN,- CSS_PT,- CSS_PC,- CSS_DEG,- CSS_RAD,- CSS_GRAD,- CSS_MS,- CSS_S,- CSS_HZ,- CSS_KHZ,- CSS_DIMENSION).
- Returns:
- The float value in the specified unit.
- Throws:
- DOMException- INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a float value or if the float value can't be converted into the specified unit.
 
- 
setStringValue- Specified by:
- setStringValuein interface- CSSPrimitiveValue
- Throws:
- DOMException
 
- 
getStringValue- Specified by:
- getStringValuein interface- CSSPrimitiveValue
- Throws:
- DOMException
 
- 
getCounterValue- Specified by:
- getCounterValuein interface- CSSPrimitiveValue
- Throws:
- DOMException
 
- 
getRectValue- Specified by:
- getRectValuein interface- CSSPrimitiveValue
- Throws:
- DOMException
 
- 
getRGBColorValueDescription copied from interface:CSSPrimitiveValue2Get the RGBA color. If this CSS value doesn't contain a RGB color value, aDOMExceptionis raised.- Specified by:
- getRGBColorValuein interface- CSSPrimitiveValue
- Specified by:
- getRGBColorValuein interface- CSSPrimitiveValue2
- Returns:
- the RGBA color value.
- Throws:
- DOMException- INVALID_ACCESS_ERR: Raised if the attached property can't return a RGB color value (e.g. this is not- CSS_RGBCOLOR).
 
- 
setSubpropertypublic void setSubproperty(boolean subp) 
- 
isSubpropertypublic boolean isSubproperty()Description copied from class:StyleValueIs this a subproperty that has been set by a shorthand?- Overrides:
- isSubpropertyin class- StyleValue
- Returns:
- trueif this a subproperty that has been set by a shorthand,- falseotherwise.
 
- 
isCalculatedNumberpublic boolean isCalculatedNumber()Description copied from interface:CSSPrimitiveValue2Test whether this is a numeric value that was the result of acalc()expression.- Specified by:
- isCalculatedNumberin interface- CSSPrimitiveValue2
- Returns:
- trueif this is a numeric value, and it was produced as the output of a calculation (instead of declared as a plain, constant numeric value).
 
- 
isNegativeNumberpublic boolean isNegativeNumber()Description copied from interface:CSSPrimitiveValue2Test whether this is a numeric value that is less than zero.- Specified by:
- isNegativeNumberin interface- CSSPrimitiveValue2
- Returns:
- trueif this is a numeric value and its value is negative.
 
- 
isNumberZeropublic boolean isNumberZero()Is this value a number set to a value of zero, or an absolute value less than 1e-5 ?- Specified by:
- isNumberZeroin interface- ExtendedCSSPrimitiveValue
- Returns:
- trueif this is a number and is set to zero (or equivalently small value).
 
- 
setExpectIntegerpublic void setExpectInteger()
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- StyleValue
 
- 
equals- Overrides:
- equalsin class- StyleValue
 
- 
cloneCreates and returns a copy of this object.The object will be the same except for the subpropertyflag, that will be disabled in the clone object.- Specified by:
- clonein interface- ExtendedCSSValue
- Specified by:
- clonein class- StyleValue
- Returns:
- a copy of this object.
 
 
-