Class 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
      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.
      isPrimitiveValue in class StyleValue
      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?
      isSubproperty in class StyleValue
      true if this a subproperty that has been set by a shorthand, false otherwise.
    • hashCode

      public int hashCode()
      hashCode in class StyleValue
    • equals

      public boolean equals(Object obj)
      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
      a copy of this object.