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 TypeMethodDescriptionbooleanintReturn the dimension of this numeric.intgetEnum()This method expects to be overridden by subclassesstatic EnumNumbergetInstance(Property enumProperty) Returns the canonical EnumNumber instance corresponding to the given PropertyThis method expects to be overridden by subclassesdoubleReturn the value of this NumericdoublegetNumericValue(PercentBaseContext context) Return the value of this NumericThis method expects to be overridden by subclassesThis method expects to be overridden by subclasses.intgetValue()Returns the value of this numeric as an int.intgetValue(PercentBaseContext context) Returns the value of this numeric as an int.inthashCode()booleanReturn 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:
getDimensionin 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. Alwaystruefor instances of this type- Specified by:
isAbsolutein 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:
getNumericValuein 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:
getNumericValuein interfaceNumeric- Returns:
- the computed value.
-
getNumeric
This method expects to be overridden by subclasses- Overrides:
getNumericin classProperty- Returns:
- Numeric property value
-