org.apache.fop.datatypes
Interface Numeric
- Length
- EnumLength, EnumNumber, FixedLength, LengthProperty, NumberProperty, NumericProperty, PercentLength, RelativeNumericProperty, TableColLength
An interface for classes that can participate in numeric operations.
All the numeric operation (+, -, *, ...) are expressed in terms of
this Numeric interface.
Numerics has a value (getNumericValue) and a dimension (getDimension).
Numerics can be either absolute or relative. Relative numerics
must be resolved against base value before the value can be used.
To support relative numerics internally in the expresion parser and
during evaulation one additional methods exists: isAbsolute() which
return true for absolute numerics and false for relative numerics.
getDimension
public int getDimension()
Return the dimension of this numeric. Plain numbers has a dimension of
0 and length has a dimension of 1. Other dimension can occur as a result
of multiplications and divisions.
getEnum
public int getEnum()
Return the enum value that is stored in this numeric.
getNumericValue
public double getNumericValue()
throws PropertyException
Return the value of this Numeric
getNumericValue
public double getNumericValue(PercentBaseContext context)
throws PropertyException
Return the value of this Numeric
context
- The context for the length calculation (for percentage based lengths)
getValue
public int getValue()
Returns the value of this numeric as an int.
getValue
public int getValue(PercentBaseContext context)
Returns the value of this numeric as an int.
context
- the context for the length calculation (for percentage based lengths)
isAbsolute
public boolean isAbsolute()
Return true if the numeric is an absolute value. Relative values are
percentages and table-column-units. All other numerics are absolute.
- true when the numeric is absolute.
Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.