Package org.apache.fop.fo.properties
Class NumberProperty
- java.lang.Object
-
- org.apache.fop.fo.properties.Property
-
- org.apache.fop.fo.properties.NumberProperty
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NumberProperty.Maker
Inner class for making NumberProperty objectsstatic class
NumberProperty.PositiveIntegerMaker
A positive integer property maker.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.awt.Color
getColor(FOUserAgent foUserAgent)
Convert NumberProperty to a Color.int
getDimension()
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(java.lang.Double num)
Returns the canonical NumberProperty instance corresponding to the given Numberstatic NumberProperty
getInstance(java.lang.Integer num)
Returns the canonical NumberProperty instance corresponding to the given IntegerLength
getLength()
This method expects to be overridden by subclassesjava.lang.Number
getNumber()
This method expects to be overridden by subclassesNumeric
getNumeric()
Convert NumberProperty to Numeric objectdouble
getNumericValue()
Return the value of this Numeric.double
getNumericValue(PercentBaseContext context)
Return the value of this Numeric.java.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)
Return the valueint
hashCode()
boolean
isAbsolute()
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 Detail
-
getInstance
public static NumberProperty getInstance(java.lang.Double num)
Returns the canonical NumberProperty instance corresponding to the given Number- Parameters:
num
- the base Double- Returns:
- the canonical NumberProperty
-
getInstance
public static NumberProperty getInstance(java.lang.Integer num)
Returns the canonical NumberProperty instance corresponding to the given Integer- Parameters:
num
- the base Integer- Returns:
- the canonical NumberProperty
-
getInstance
public static NumberProperty getInstance(double num)
Returns the canonical NumberProperty instance corresponding to the given double- Parameters:
num
- the base double value- Returns:
- the canonical NumberProperty
-
getInstance
public static NumberProperty getInstance(int num)
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
public double getNumericValue(PercentBaseContext context)
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
public int getValue(PercentBaseContext context)
Return the value
-
isAbsolute
public boolean isAbsolute()
Return true because all numbers are absolute.- Specified by:
isAbsolute
in interfaceNumeric
- Returns:
- true.
-
getNumber
public java.lang.Number getNumber()
Description copied from class:Property
This method expects to be overridden by subclasses
-
getObject
public java.lang.Object getObject()
Description copied from class:Property
This method expects to be overridden by subclasses
-
getNumeric
public Numeric getNumeric()
Convert NumberProperty to Numeric object- Overrides:
getNumeric
in classProperty
- Returns:
- Numeric object corresponding to this
-
getLength
public Length getLength()
This method expects to be overridden by subclasses
-
getColor
public java.awt.Color getColor(FOUserAgent foUserAgent)
Convert NumberProperty to a Color. Not sure why this is needed.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-