Package 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
A number quantity in XSL which is specified as an enum, such as "no-limit".
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Return the dimension of this numeric.int
getEnum()
This method expects to be overridden by subclassesstatic EnumNumber
getInstance
(Property enumProperty) Returns the canonical EnumNumber instance corresponding to the given PropertyThis method expects to be overridden by subclassesdouble
Return the value of this Numericdouble
getNumericValue
(PercentBaseContext context) Return the value of this NumericThis method expects to be overridden by subclassesThis 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
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
-
Method Details
-
getInstance
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 -
getString
This method expects to be overridden by subclasses. -
getObject
This method expects to be overridden by subclasses -
equals
-
hashCode
public int hashCode() -
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 interfaceNumeric
- 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. Alwaystrue
for instances of this type- Specified by:
isAbsolute
in interfaceNumeric
- Returns:
- true when the numeric is absolute.
-
getNumericValue
Return the value of this Numeric logs an error, because it's not supposed to be called- Specified by:
getNumericValue
in interfaceNumeric
- Parameters:
context
- The context for the length calculation (for percentage based lengths)- Returns:
- the computed value.
-
getValue
Returns the value of this numeric as an int. logs an error, because it's not supposed to be called -
getValue
public int getValue()Returns the value of this numeric as an int. logs an error, because it's not supposed to be called -
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 interfaceNumeric
- Returns:
- the computed value.
-
getNumeric
This method expects to be overridden by subclasses- Overrides:
getNumeric
in classProperty
- Returns:
- Numeric property value
-