org.apache.fop.fo.properties

## Class EnumNumber

- java.lang.Object
- - org.apache.fop.fo.properties.Property
  - - org.apache.fop.fo.properties.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".

- - ### Field Summary

    - ### Fields inherited from class org.apache.fop.fo.properties.Property

      `log`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `int` | `getDimension()` Return the dimension of this numeric.
    `int` | `getEnum()` This method expects to be overridden by subclasses
    `static EnumNumber` | `getInstance(Property enumProperty)` Returns the canonical EnumNumber instance corresponding to the given Property
    `Numeric` | `getNumeric()` This method expects to be overridden by subclasses
    `double` | `getNumericValue()` Return the value of this Numeric
    `double` | `getNumericValue(PercentBaseContext context)` Return the value of this Numeric
    `Object` | `getObject()` This method expects to be overridden by subclasses
    `String` | `getString()` This method expects to be overridden by subclasses.
    `int` | `getValue()` Returns the value of this numeric as an int.
    `int` | `getValue(PercentBaseContext context)` Returns the value of this numeric as an int.
    `int` | `hashCode()`
    `boolean` | `isAbsolute()` Return true if the numeric is an absolute value.

    - ### Methods inherited from class org.apache.fop.fo.properties.Property

      `getCharacter, getColor, getCondLength, getKeep, getLength, getLengthPair, getLengthRange, getList, getNCname, getNumber, getSpace, getSpecifiedValue, isAuto, setSpecifiedValue, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### 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 String getString()

      This method expects to be overridden by subclasses.
      Overrides:
        `getString` in class `Property`
      Returns:
        String property value

    - #### getObject

          public Object getObject()

      This method expects to be overridden by subclasses
      Overrides:
        `getObject` in class `Property`
      Returns:
        Object property value

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `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

Copyright © 2023 Apache Software Foundation. All rights reserved.