Package org.apache.fop.fo.properties
Class EnumNumber
- java.lang.Object
-
- org.apache.fop.fo.properties.Property
-
- org.apache.fop.fo.properties.EnumNumber
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)intgetDimension()Return 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 PropertyNumericgetNumeric()This method expects to be overridden by subclassesdoublegetNumericValue()Return the value of this NumericdoublegetNumericValue(PercentBaseContext context)Return the value of this Numericjava.lang.ObjectgetObject()This method expects to be overridden by subclassesjava.lang.StringgetString()This 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()booleanisAbsolute()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 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
-
getString
public java.lang.String getString()
This method expects to be overridden by subclasses.
-
getObject
public java.lang.Object getObject()
This method expects to be overridden by subclasses
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.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:
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
public double getNumericValue(PercentBaseContext context)
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
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
-
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
public Numeric getNumeric()
This method expects to be overridden by subclasses- Overrides:
getNumericin classProperty- Returns:
- Numeric property value
-
-