fop 0.91beta

org.apache.fop.fo.properties
Class PercentLength

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

public class PercentLength
extends LengthProperty

a percent specified length quantity in XSL


Inner classes inherited from class org.apache.fop.fo.properties.LengthProperty
LengthProperty.Maker
 
Fields inherited from class org.apache.fop.fo.properties.Property
log
 
Constructor Summary
PercentLength(double factor, PercentBase lbase)
          Main constructor.
 
Method Summary
 PercentBase getBaseLength()
           
 double getNumericValue()
          Return the value of this Numeric
 double getNumericValue(PercentBaseContext context)
          Return the value of this Numeric
 int getValue()
          Return the length of this PercentLength.
 int getValue(PercentBaseContext context)
          Returns the length in 1/1000ths of a point (millipoints)
 boolean isAbsolute()
          Return false because percent-length are always relative.
 java.lang.String toString()
           
 double value()
           
 
Methods inherited from class org.apache.fop.fo.properties.LengthProperty
getDimension, getLength, getNumeric, getObject, getTableUnits
 
Methods inherited from class org.apache.fop.fo.properties.Property
getCharacter, getColorType, getCondLength, getEnum, getKeep, getLengthPair, getLengthRange, getList, getNCname, getNumber, 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

PercentLength

public PercentLength(double factor,
                     PercentBase lbase)
Main constructor. Construct an object based on a factor (the percent, as a factor) and an object which has a method to return the Length which provides the "base" for the actual length that is modeled.
Parameters:
factor - the percentage factor, expressed as a decimal (e.g. use .95 to represent 95%)
lbase - base property to which the factor should be applied
Method Detail

getBaseLength

public PercentBase getBaseLength()
Returns:
the base

value

public double value()
Returns:
the factor TODO: Should this really exists?

isAbsolute

public boolean isAbsolute()
Return false because percent-length are always relative.
See Also:
Numeric.isAbsolute()

getNumericValue

public double getNumericValue()
Description copied from interface: Numeric
Return the value of this Numeric
See Also:
Numeric.getNumericValue()

getNumericValue

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

getValue

public int getValue()
Return the length of this PercentLength.
See Also:
Length.getValue()

getValue

public int getValue(PercentBaseContext context)
Description copied from interface: Length
Returns the length in 1/1000ths of a point (millipoints)
See Also:
Numeric.getValue(PercentBaseContext)

toString

public java.lang.String toString()
Overrides:
toString in class Property
Returns:
the String equivalent of this

fop 0.91beta

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