fop 0.90alpha1

org.apache.fop.fo.expr
Class NumericProperty

java.lang.Object
  |
  +--org.apache.fop.fo.properties.Property
        |
        +--org.apache.fop.fo.expr.NumericProperty
All Implemented Interfaces:
Length, Numeric

public class NumericProperty
extends Property
implements Numeric, Length

A numeric property which hold the final absolute result of an expression calculations.


Fields inherited from class org.apache.fop.fo.properties.Property
log
 
Constructor Summary
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
 ColorTypeProperty getColorType()
          Cast this as a ColorTypeProperty.
 int getDimension()
          Return the dimension.
 Length getLength()
          Cast this as a length.
 java.lang.Number getNumber()
          Cast this as a number.
 Numeric getNumeric()
          Cast this as a Numeric.
 double getNumericValue()
          Return the value.
 double getNumericValue(PercentBaseContext context)
          Return the value of this Numeric
 java.lang.Object getObject()
          Cast this as an Object.
 int getValue()
          Returns the value of this numeric as an int.
 int getValue(PercentBaseContext context)
          Returns the value of this numeric as an int.
 boolean isAbsolute()
          Return true of the numeric is absolute.
 java.lang.String toString()
          Return a string representation of this Numeric.
 
Methods inherited from class org.apache.fop.fo.properties.Property
getCharacter, getCondLength, getEnum, getKeep, getLengthPair, getLengthRange, getList, getNCname, getSpace, getSpecifiedValue, getString, isAuto, setSpecifiedValue
 
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

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.
Specified by:
getDimension in interface Numeric
See Also:
Numeric.getDimension()

getNumericValue

public double getNumericValue()
Return the value.
Specified by:
getNumericValue in interface Numeric
See Also:
Numeric.getNumericValue()

getNumericValue

public double getNumericValue(PercentBaseContext context)
Description copied from interface: Numeric
Return the value of this Numeric
Specified by:
getNumericValue in interface Numeric
See Also:
Numeric.getNumericValue(PercentBaseContext)

isAbsolute

public boolean isAbsolute()
Return true of the numeric is absolute.
Specified by:
isAbsolute in interface Numeric
See Also:
Numeric.isAbsolute()

getNumeric

public Numeric getNumeric()
Cast this as a Numeric.
Overrides:
getNumeric in class Property
Following copied from class: org.apache.fop.fo.properties.Property
Returns:
Numeric property value

getNumber

public java.lang.Number getNumber()
Cast this as a number.
Overrides:
getNumber in class Property
Following copied from class: org.apache.fop.fo.properties.Property
Returns:
Number property value

getValue

public int getValue()
Description copied from interface: Numeric
Returns the value of this numeric as an int.
Specified by:
getValue in interface Numeric
See Also:
Numeric.getValue()

getValue

public int getValue(PercentBaseContext context)
Description copied from interface: Numeric
Returns the value of this numeric as an int.
Specified by:
getValue in interface Numeric
See Also:
Numeric.getValue(PercentBaseContext)

getLength

public Length getLength()
Cast this as a length. That is only possible when the dimension is one.
Overrides:
getLength in class Property
Following copied from class: org.apache.fop.fo.properties.Property
Returns:
Length property value

getColorType

public ColorTypeProperty getColorType()
Cast this as a ColorTypeProperty.
Overrides:
getColorType in class Property
Following copied from class: org.apache.fop.fo.properties.Property
Returns:
ColorType property value

getObject

public java.lang.Object getObject()
Cast this as an Object.
Overrides:
getObject in class Property
Following copied from class: org.apache.fop.fo.properties.Property
Returns:
Object property value

toString

public java.lang.String toString()
Return a string representation of this Numeric. It is only useable for debugging.
Overrides:
toString in class Property
Following copied from class: org.apache.fop.fo.properties.Property
See Also:
Object.toString()

fop 0.90alpha1

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