Package org.apache.fop.fo.properties
Class NumberProperty
java.lang.Object
org.apache.fop.fo.properties.Property
org.apache.fop.fo.properties.NumberProperty
- All Implemented Interfaces:
Numeric
Class for handling numeric properties
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Inner class for making NumberProperty objectsstatic class
A positive integer property maker. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getColor
(FOUserAgent foUserAgent) Convert NumberProperty to a Color.int
Plain number always has a dimension of 0.static NumberProperty
getInstance
(double num) Returns the canonical NumberProperty instance corresponding to the given doublestatic NumberProperty
getInstance
(int num) Returns the canonical NumberProperty instance corresponding to the given intstatic NumberProperty
getInstance
(Double num) Returns the canonical NumberProperty instance corresponding to the given Numberstatic NumberProperty
getInstance
(Integer num) Returns the canonical NumberProperty instance corresponding to the given IntegerThis method expects to be overridden by subclassesThis method expects to be overridden by subclassesConvert NumberProperty to Numeric objectdouble
Return the value of this Numeric.double
getNumericValue
(PercentBaseContext context) Return the value of this Numeric.This method expects to be overridden by subclassesint
getValue()
Returns the value of this numeric as an int.int
getValue
(PercentBaseContext context) Return the valueint
hashCode()
boolean
Return true because all numbers are absolute.Methods inherited from class org.apache.fop.fo.properties.Property
getCharacter, getCondLength, getEnum, getKeep, getLengthPair, getLengthRange, getList, getNCname, getSpace, getSpecifiedValue, getString, isAuto, setSpecifiedValue, toString
-
Method Details
-
getInstance
Returns the canonical NumberProperty instance corresponding to the given Number- Parameters:
num
- the base Double- Returns:
- the canonical NumberProperty
-
getInstance
Returns the canonical NumberProperty instance corresponding to the given Integer- Parameters:
num
- the base Integer- Returns:
- the canonical NumberProperty
-
getInstance
Returns the canonical NumberProperty instance corresponding to the given double- Parameters:
num
- the base double value- Returns:
- the canonical NumberProperty
-
getInstance
Returns the canonical NumberProperty instance corresponding to the given int- Parameters:
num
- the base int value- Returns:
- the canonical NumberProperty
-
getDimension
public int getDimension()Plain number always has a dimension of 0.- Specified by:
getDimension
in interfaceNumeric
- Returns:
- a dimension of 0.
-
getNumericValue
public double getNumericValue()Return the value of this Numeric.- Specified by:
getNumericValue
in interfaceNumeric
- Returns:
- The value as a double.
-
getNumericValue
Return the value of this Numeric.- Specified by:
getNumericValue
in interfaceNumeric
- Parameters:
context
- Evaluation context- Returns:
- The value as a double.
-
getValue
public int getValue()Returns the value of this numeric as an int. -
getValue
Return the value -
isAbsolute
public boolean isAbsolute()Return true because all numbers are absolute.- Specified by:
isAbsolute
in interfaceNumeric
- Returns:
- true.
-
getNumber
Description copied from class:Property
This method expects to be overridden by subclasses -
getObject
Description copied from class:Property
This method expects to be overridden by subclasses -
getNumeric
Convert NumberProperty to Numeric object- Overrides:
getNumeric
in classProperty
- Returns:
- Numeric object corresponding to this
-
getLength
This method expects to be overridden by subclasses -
getColor
Convert NumberProperty to a Color. Not sure why this is needed. -
equals
-
hashCode
public int hashCode()
-