Class PrimitiveValue

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

public abstract class PrimitiveValue extends StyleValue implements CSSPrimitiveValue
Base implementation for primitive values.
See Also:
  • Constructor Details

  • Method Details

    • getPrimitiveType

      public CSSValue.Type getPrimitiveType()
      Description copied from interface: CSSValue
      Get the primitive type.
      Specified by:
      getPrimitiveType in interface CSSValue
      Returns:
      the primitive type.
    • isPrimitiveValue

      public boolean isPrimitiveValue()
      Description copied from class: StyleValue
      Check whether this value is primitive, that is, either a TYPED or PROXY value.
      Overrides:
      isPrimitiveValue in class StyleValue
      Returns:
      true if the value is TYPED or PROXY.
    • setExpectInteger

      public void 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 interface CSSPrimitiveValue
    • 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 class StyleValue
      Returns:
      true if this a subproperty that has been set by a shorthand, false otherwise.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class StyleValue
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class StyleValue
    • clone

      public abstract PrimitiveValue 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 interface CSSValue
      Specified by:
      clone in class StyleValue
      Returns:
      a copy of this object.