fop 0.92beta

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
Direct Known Subclasses:
EnumNumber

public class NumberProperty
extends Property
implements Numeric

Class for handling numeric properties


Inner Class Summary
static class NumberProperty.Maker
          Inner class for making NumberProperty objects
 
Fields inherited from class org.apache.fop.fo.properties.Property
log
 
Constructor Summary
NumberProperty(double num)
          Constructor for double input
NumberProperty(int num)
          Constructor for integer input
NumberProperty(java.lang.Number num)
          Constructor for Number input
 
Method Summary
 ColorTypeProperty getColorType()
          Convert NumberProperty to a ColorType.
 int getDimension()
          Plain number always has a dimension of 0.
 java.lang.Number getNumber()
          This method expects to be overridden by subclasses
 Numeric getNumeric()
          Convert NumberProperty to Numeric object
 double 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 subclasses
 int getValue()
          Returns the value of this numeric as an int.
 int getValue(PercentBaseContext context)
          Return the value
 boolean isAbsolute()
          Return true because all numbers are absolute.
 
Methods inherited from class org.apache.fop.fo.properties.Property
getCharacter, getCondLength, getEnum, getKeep, getLength, getLengthPair, getLengthRange, getList, getNCname, getSpace, getSpecifiedValue, getString, isAuto, setSpecifiedValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.fop.datatypes.Numeric
getEnum
 

Constructor Detail

NumberProperty

public NumberProperty(java.lang.Number num)
Constructor for Number input
Parameters:
num - Number object value for property

NumberProperty

public NumberProperty(double num)
Constructor for double input
Parameters:
num - double numeric value for property

NumberProperty

public NumberProperty(int num)
Constructor for integer input
Parameters:
num - integer numeric value for property
Method Detail

getDimension

public int getDimension()
Plain number always has a dimension of 0.
Specified by:
getDimension in interface Numeric
Returns:
a dimension of 0.
See Also:
Numeric.getDimension()

getNumericValue

public double getNumericValue()
Return the value of this Numeric.
Specified by:
getNumericValue in interface Numeric
Returns:
The value as a double.
See Also:
Numeric.getNumericValue()

getNumericValue

public double getNumericValue(PercentBaseContext context)
Return the value of this Numeric.
Specified by:
getNumericValue in interface Numeric
Parameters:
context - Evaluation context
Returns:
The value as a double.
See Also:
Numeric.getNumericValue(PercentBaseContext)

getValue

public int getValue()
Description copied from interface: Numeric
Returns the value of this numeric as an int.
Specified by:
getValue in interface Numeric
Following copied from interface: org.apache.fop.datatypes.Numeric
Returns:
the value as an integer.

getValue

public int getValue(PercentBaseContext context)
Return the value
Specified by:
getValue in interface Numeric
Parameters:
context - Evaluation context
Returns:
The value as an int.
See Also:
Numeric.getValue(PercentBaseContext)

isAbsolute

public boolean isAbsolute()
Return true because all numbers are absolute.
Specified by:
isAbsolute in interface Numeric
Returns:
true.
See Also:
Numeric.isAbsolute()

getNumber

public java.lang.Number getNumber()
Description copied from class: Property
This method expects to be overridden by subclasses
Overrides:
getNumber in class Property
Returns:
this.number cast as a Number

getObject

public java.lang.Object getObject()
Description copied from class: Property
This method expects to be overridden by subclasses
Overrides:
getObject in class Property
Returns:
this.number cast as an Object

getNumeric

public Numeric getNumeric()
Convert NumberProperty to Numeric object
Overrides:
getNumeric in class Property
Returns:
Numeric object corresponding to this

getColorType

public ColorTypeProperty getColorType()
Convert NumberProperty to a ColorType. Not sure why this is needed.
Overrides:
getColorType in class Property
Returns:
ColorType that corresponds to black

fop 0.92beta

Copyright 1999-2006 The Apache Software Foundation. All Rights Reserved.