fop 0.95

org.apache.fop.datatypes
Interface Numeric

All Known Subinterfaces:
Length
All Known Implementing Classes:
EnumLength, EnumNumber, FixedLength, LengthProperty, NumberProperty, NumericProperty, PercentLength, RelativeNumericProperty, TableColLength

public interface Numeric

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.


Method Summary
 int getDimension()
          Return the dimension of this numeric.
 int getEnum()
          Return the enum value that is stored in this numeric.
 double getNumericValue()
          Return the value of this Numeric
 double getNumericValue(PercentBaseContext context)
          Return the value of this Numeric
 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 if the numeric is an absolute value.
 

Method Detail

getNumericValue

double getNumericValue()
                       throws PropertyException
Return the value of this Numeric

Returns:
the computed value.
Throws:
PropertyException

getNumericValue

double getNumericValue(PercentBaseContext context)
                       throws PropertyException
Return the value of this Numeric

Parameters:
context - The context for the length calculation (for percentage based lengths)
Returns:
the computed value.
Throws:
PropertyException

getDimension

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.

Returns:
the dimension.

isAbsolute

boolean isAbsolute()
Return true if the numeric is an absolute value. Relative values are percentages and table-column-units. All other numerics are absolute.

Returns:
true when the numeric is absolute.

getValue

int getValue()
Returns the value of this numeric as an int.

Returns:
the value as an integer.

getValue

int getValue(PercentBaseContext context)
Returns the value of this numeric as an int.

Parameters:
context - the context for the length calculation (for percentage based lengths)
Returns:
the value as an integer.

getEnum

int getEnum()
Return the enum value that is stored in this numeric.


fop 0.95

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