Package org.apache.fop.fo.expr
Class NumericProperty
java.lang.Object
org.apache.fop.fo.properties.Property
org.apache.fop.fo.expr.NumericProperty
A numeric property which hold the final absolute result of an expression
calculations.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
NumericProperty
(double value, int dim) Construct a Numeric object by specifying one or more components, including absolute length, percent length, table units. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getColor
(FOUserAgent foUserAgent) This method expects to be overridden by subclassesint
Return the dimension.This method expects to be overridden by subclassesThis method expects to be overridden by subclassesThis method expects to be overridden by subclassesdouble
Return the value.double
getNumericValue
(PercentBaseContext context) Return the value of this NumericThis method expects to be overridden by subclassesint
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 of the numeric is absolute.toString()
Methods inherited from class org.apache.fop.fo.properties.Property
getCharacter, getCondLength, getEnum, getKeep, getLengthPair, getLengthRange, getList, getNCname, getSpace, getSpecifiedValue, getString, isAuto, setSpecifiedValue
-
Constructor Details
-
NumericProperty
protected NumericProperty(double value, int dim) Construct a Numeric object by specifying one or more components, including absolute length, percent length, table units.- Parameters:
value
- The value of the numeric.dim
- The dimension of the value. 0 for a Number, 1 for a Length (any type), >1, <0 if Lengths have been multiplied or divided.
-
-
Method Details
-
getDimension
public int getDimension()Return the dimension. 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.
-
getNumericValue
public double getNumericValue()Return the value. Return the value of this Numeric- Specified by:
getNumericValue
in interfaceNumeric
- Returns:
- the computed value.
-
getNumericValue
Return the value of this Numeric- Specified by:
getNumericValue
in interfaceNumeric
- Parameters:
context
- The context for the length calculation (for percentage based lengths)- Returns:
- the computed value.
-
isAbsolute
public boolean isAbsolute()Return true of the numeric is absolute. Return true if the numeric is an absolute value. Relative values are percentages and table-column-units. All other numerics are absolute.- Specified by:
isAbsolute
in interfaceNumeric
- Returns:
- true when the numeric is absolute.
-
getNumeric
This method expects to be overridden by subclasses- Overrides:
getNumeric
in classProperty
- Returns:
- Numeric property value
-
getNumber
This method expects to be overridden by subclasses -
getValue
public int getValue()Returns the value of this numeric as an int. -
getValue
Returns the value of this numeric as an int. -
getLength
This method expects to be overridden by subclasses -
getColor
This method expects to be overridden by subclasses -
getObject
This method expects to be overridden by subclasses -
toString
-
hashCode
public int hashCode() -
equals
-