Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 1.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.fop.datatypes
Interface Numeric

All Known Subinterfaces:
  Length

All Known Implementing Classes:
  EnumNumber, LengthProperty, NumberProperty, NumericProperty, RelativeNumericProperty

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

    public double getNumericValue()
                           throws PropertyException

  Return the value of this Numeric

  Returns:
    the computed value.
  Throws:
    `PropertyException`

### getNumericValue

    public 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

    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.

  Returns:
    the dimension.

### 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.

  Returns:
    true when the numeric is absolute.

### getValue

    public int getValue()

  Returns the value of this numeric as an int.

  Returns:
    the value as an integer.

### getValue

    public 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

    public int getEnum()

  Return the enum value that is stored in this numeric.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 1.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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