Package org.apache.fop.fo.expr
Class NumericProperty
- java.lang.Object
-
- org.apache.fop.fo.properties.Property
-
- org.apache.fop.fo.expr.NumericProperty
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
NumericProperty(double value, int dim)
Construct a Numeric object by specifying one or more components, including absolute length, percent length, table units.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.awt.Color
getColor(FOUserAgent foUserAgent)
This method expects to be overridden by subclassesint
getDimension()
Return the dimension.Length
getLength()
This method expects to be overridden by subclassesjava.lang.Number
getNumber()
This method expects to be overridden by subclassesNumeric
getNumeric()
This method expects to be overridden by subclassesdouble
getNumericValue()
Return the value.double
getNumericValue(PercentBaseContext context)
Return the value of this Numericjava.lang.Object
getObject()
This 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
isAbsolute()
Return true of the numeric is absolute.java.lang.String
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 Detail
-
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 Detail
-
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
public double getNumericValue(PercentBaseContext context)
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
public Numeric getNumeric()
This method expects to be overridden by subclasses- Overrides:
getNumeric
in classProperty
- Returns:
- Numeric property value
-
getNumber
public java.lang.Number getNumber()
This method expects to be overridden by subclasses
-
getValue
public int getValue()
Returns the value of this numeric as an int.
-
getValue
public int getValue(PercentBaseContext context)
Returns the value of this numeric as an int.
-
getLength
public Length getLength()
This method expects to be overridden by subclasses
-
getColor
public java.awt.Color getColor(FOUserAgent foUserAgent)
This method expects to be overridden by subclasses
-
getObject
public java.lang.Object getObject()
This method expects to be overridden by subclasses
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-