Package org.apache.fop.fo.properties
Class EnumNumber
- java.lang.Object
-
- org.apache.fop.fo.properties.Property
-
- org.apache.fop.fo.properties.EnumNumber
-
-
Field Summary
Fields Modifier and Type Field Description private static PropertyCache<EnumNumber>
CACHE
cache holding all canonical EnumNumber instancesprivate EnumProperty
enumProperty
-
Constructor Summary
Constructors Modifier Constructor Description private
EnumNumber(Property enumProperty)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
int
getDimension()
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 PropertyNumeric
getNumeric()
This method expects to be overridden by subclassesdouble
getNumericValue()
Return the value of this Numericdouble
getNumericValue(PercentBaseContext context)
Return the value of this Numericjava.lang.Object
getObject()
This method expects to be overridden by subclassesjava.lang.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
-
-
-
-
Field Detail
-
CACHE
private static final PropertyCache<EnumNumber> CACHE
cache holding all canonical EnumNumber instances
-
enumProperty
private final EnumProperty enumProperty
-
-
Constructor Detail
-
EnumNumber
private EnumNumber(Property enumProperty)
Constructor- Parameters:
enumProperty
- the base EnumProperty
-
-
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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in 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:
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
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 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:
getNumericValue
in interfaceNumeric
- Returns:
- the computed value.
-
getNumeric
public Numeric getNumeric()
This method expects to be overridden by subclasses- Overrides:
getNumeric
in classProperty
- Returns:
- Numeric property value
-
-