java.lang.Object
io.sf.carte.doc.style.css.property.StyleValue
io.sf.carte.doc.style.css.property.PrimitiveValue
- All Implemented Interfaces:
CSSPrimitiveValue
,CSSValue
,Serializable
,Cloneable
- Direct Known Subclasses:
ProxyValue
,TypedValue
Base implementation for primitive values.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.sf.carte.doc.style.css.CSSValue
CSSValue.CssType, CSSValue.Type
-
Constructor Summary
ModifierConstructorDescriptionprotected
PrimitiveValue
(CSSValue.Type unitType) protected
PrimitiveValue
(PrimitiveValue copied) -
Method Summary
Modifier and TypeMethodDescriptionabstract PrimitiveValue
clone()
Creates and returns a copy of this object.boolean
Get the primitive type.int
hashCode()
boolean
boolean
Is this a subproperty that has been set by a shorthand?void
This value is expected to contain an integer.void
setSubproperty
(boolean subp) Methods inherited from class io.sf.carte.doc.style.css.property.StyleValue
getCssText, getMinifiedCssText, isSystemDefault, matches, setCssText, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.sf.carte.doc.style.css.CSSPrimitiveValue
getUnitType, isNegativeNumber
Methods inherited from interface io.sf.carte.doc.style.css.CSSValue
getCssText, getCssValueType, getMinifiedCssText, getMinifiedCssText, matches, setCssText, writeCssText
-
Constructor Details
-
PrimitiveValue
-
PrimitiveValue
-
-
Method Details
-
getPrimitiveType
Description copied from interface:CSSValue
Get the primitive type.- Specified by:
getPrimitiveType
in interfaceCSSValue
- Returns:
- the primitive type.
-
isPrimitiveValue
public boolean isPrimitiveValue()Description copied from interface:CSSPrimitiveValue
- Specified by:
isPrimitiveValue
in interfaceCSSPrimitiveValue
- Specified by:
isPrimitiveValue
in interfaceCSSValue
- Returns:
true
if the value isTYPED
orPROXY
.
-
setExpectInteger
Description copied from interface:CSSPrimitiveValue
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.- Specified by:
setExpectInteger
in interfaceCSSPrimitiveValue
- Throws:
DOMException
- TYPE_MISMATCH_ERR if the value is a constant number and not an integer.
-
setSubproperty
public void setSubproperty(boolean subp) -
isSubproperty
public boolean isSubproperty()Description copied from class:StyleValue
Is this a subproperty that has been set by a shorthand?- Overrides:
isSubproperty
in classStyleValue
- Returns:
true
if this a subproperty that has been set by a shorthand,false
otherwise.
-
hashCode
public int hashCode()- Overrides:
hashCode
in classStyleValue
-
equals
- Overrides:
equals
in classStyleValue
-
clone
Creates and returns a copy of this object.The object will be the same except for the
subproperty
flag, that will be disabled in the clone object.- Specified by:
clone
in interfaceCSSValue
- Specified by:
clone
in classStyleValue
- Returns:
- a copy of this object.
-