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 protectedNumericProperty(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 booleanequals(java.lang.Object obj)java.awt.ColorgetColor(FOUserAgent foUserAgent)This method expects to be overridden by subclassesintgetDimension()Return the dimension.LengthgetLength()This method expects to be overridden by subclassesjava.lang.NumbergetNumber()This method expects to be overridden by subclassesNumericgetNumeric()This method expects to be overridden by subclassesdoublegetNumericValue()Return the value.doublegetNumericValue(PercentBaseContext context)Return the value of this Numericjava.lang.ObjectgetObject()This method expects to be overridden by subclassesintgetValue()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 of the numeric is absolute.java.lang.StringtoString()-
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:
getDimensionin interfaceNumeric- Returns:
- the dimension.
-
getNumericValue
public double getNumericValue()
Return the value. Return the value of this Numeric- Specified by:
getNumericValuein interfaceNumeric- Returns:
- the computed value.
-
getNumericValue
public double getNumericValue(PercentBaseContext context)
Return the value of this Numeric- Specified by:
getNumericValuein 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:
isAbsolutein interfaceNumeric- Returns:
- true when the numeric is absolute.
-
getNumeric
public Numeric getNumeric()
This method expects to be overridden by subclasses- Overrides:
getNumericin 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-