Class EnumNumber

  • All Implemented Interfaces:
    Numeric

    public final class EnumNumber
    extends Property
    implements Numeric
    A number quantity in XSL which is specified as an enum, such as "no-limit".
    • Method Detail

      • getInstance

        public static EnumNumber getInstance​(Property enumProperty)
        Returns the canonical EnumNumber instance corresponding to the given Property
        Parameters:
        enumProperty - the base EnumProperty
        Returns:
        the canonical instance
      • getEnum

        public int getEnum()
        This method expects to be overridden by subclasses
        Specified by:
        getEnum in interface Numeric
        Overrides:
        getEnum in class Property
        Returns:
        integer equivalent of enumerated property value
      • getString

        public java.lang.String getString()
        This method expects to be overridden by subclasses.
        Overrides:
        getString in class Property
        Returns:
        String property value
      • getObject

        public java.lang.Object getObject()
        This method expects to be overridden by subclasses
        Overrides:
        getObject in class Property
        Returns:
        Object property value
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getDimension

        public int getDimension()
        Return the dimension of this numeric. Plain numbers has a dimension of 0 and length has a dimension of 1. Other dimension can occur as a result of multiplications and divisions.
        Specified by:
        getDimension in interface Numeric
        Returns:
        the dimension.
      • isAbsolute

        public boolean isAbsolute()
        Return true if the numeric is an absolute value. Relative values are percentages and table-column-units. All other numerics are absolute. Always true for instances of this type
        Specified by:
        isAbsolute in interface Numeric
        Returns:
        true when the numeric is absolute.
      • getNumericValue

        public double getNumericValue​(PercentBaseContext context)
        Return the value of this Numeric logs an error, because it's not supposed to be called
        Specified by:
        getNumericValue in interface Numeric
        Parameters:
        context - The context for the length calculation (for percentage based lengths)
        Returns:
        the computed value.
      • getValue

        public int getValue​(PercentBaseContext context)
        Returns the value of this numeric as an int. logs an error, because it's not supposed to be called
        Specified by:
        getValue in interface Numeric
        Parameters:
        context - the context for the length calculation (for percentage based lengths)
        Returns:
        the value as an integer.
      • getValue

        public int getValue()
        Returns the value of this numeric as an int. logs an error, because it's not supposed to be called
        Specified by:
        getValue in interface Numeric
        Returns:
        the value as an integer.
      • getNumericValue

        public double getNumericValue()
        Return the value of this Numeric logs an error, because it's not supposed to be called
        Specified by:
        getNumericValue in interface Numeric
        Returns:
        the computed value.
      • getNumeric

        public Numeric getNumeric()
        This method expects to be overridden by subclasses
        Overrides:
        getNumeric in class Property
        Returns:
        Numeric property value