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.fo.expr
Class RelativeNumericProperty

    java.lang.Object
      org.apache.fop.fo.properties.Property
          org.apache.fop.fo.expr.RelativeNumericProperty

All Implemented Interfaces:
  Length, Numeric

public class RelativeNumericProperty
extends Property
implements Length

This class represent a node in a property expression tree. It is created when an operation involve relative expression and is used to delay evaluation of the operation until the time where getNumericValue() or getValue() is called.

Field Summary
`static int` | `ABS`
`static int` | `ADDITION`
`static int` | `DIVIDE`
`static int` | `MAX`
`static int` | `MIN`
`static int` | `MODULO`
`static int` | `MULTIPLY`
`static int` | `NEGATE`
`static int` | `SUBTRACTION`

Fields inherited from class org.apache.fop.fo.properties.Property
`log`

Constructor Summary
`RelativeNumericProperty(int operation, Numeric op)` Constructor for a one argument operation.
`RelativeNumericProperty(int operation, Numeric op1, Numeric op2)` Constructor for a two argument operation.

Method Summary
`int` | `getDimension()` Return the dimension of the expression
`Length` | `getLength()` Cast this numeric as a Length.
`Numeric` | `getNumeric()` This method expects to be overridden by subclasses
`double` | `getNumericValue()` Return the resolved (calculated) value of the expression.
`double` | `getNumericValue(PercentBaseContext context)` Return the value of this Numeric
`double` | `getTableUnits()` Return the number of table units which are included in this length specification.
`int` | `getValue()` Returns the length in 1/1000ths of a point (millipoints)
`int` | `getValue(PercentBaseContext context)` Returns the length in 1/1000ths of a point (millipoints)
`boolean` | `isAbsolute()` Return false since an expression is only created when there is relative numerics involved.
`java.lang.String` | `toString()` Return a string represention of the expression.

Methods inherited from class org.apache.fop.fo.properties.Property
`getCharacter, getColor, getCondLength, getEnum, getKeep, getLengthPair, getLengthRange, getList, getNCname, getNumber, getObject, 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`

Field Detail

### ADDITION

    public static final int ADDITION

See Also:
  Constant Field Values

### SUBTRACTION

    public static final int SUBTRACTION

See Also:
  Constant Field Values

### MULTIPLY

    public static final int MULTIPLY

See Also:
  Constant Field Values

### DIVIDE

    public static final int DIVIDE

See Also:
  Constant Field Values

### MODULO

    public static final int MODULO

See Also:
  Constant Field Values

### NEGATE

    public static final int NEGATE

See Also:
  Constant Field Values

### ABS

    public static final int ABS

See Also:
  Constant Field Values

### MAX

    public static final int MAX

See Also:
  Constant Field Values

### MIN

    public static final int MIN

See Also:
  Constant Field Values

Constructor Detail

### RelativeNumericProperty

    public RelativeNumericProperty(int operation,
                                   Numeric op1,
                                   Numeric op2)

  Constructor for a two argument operation.

Parameters:
  `operation` - the operation opcode: ADDITION, SUBTRACTION, ...
  `op1` - the first operand.
  `op2` - the second operand

### RelativeNumericProperty

    public RelativeNumericProperty(int operation,
                                   Numeric op)

  Constructor for a one argument operation.

Parameters:
  `operation` - the operation opcode: NEGATE, ABS
  `op` - the operand.

Method Detail

### getNumericValue

    public double getNumericValue()
                           throws PropertyException

  Return the resolved (calculated) value of the expression. Return the value of this Numeric

  Specified by:
    `getNumericValue` in interface `Numeric`
  Returns:
    the computed value.
  Throws:
    `PropertyException`

### getNumericValue

    public double getNumericValue(PercentBaseContext context)
                           throws PropertyException

  Return the value of this Numeric

  Specified by:
    `getNumericValue` in interface `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 the expression

  Specified by:
    `getDimension` in interface `Numeric`
  Returns:
    the dimension.

### isAbsolute

    public boolean isAbsolute()

  Return false since an expression is only created when there is relative numerics involved.

  Specified by:
    `isAbsolute` in interface `Numeric`
  Returns:
    true when the numeric is absolute.

### getLength

    public Length getLength()

  Cast this numeric as a Length.

  Overrides:
    `getLength` in class `Property`
  Returns:
    Length property value

### getNumeric

    public Numeric getNumeric()

  Description copied from class: `Property`
  This method expects to be overridden by subclasses

  Overrides:
    `getNumeric` in class `Property`
  Returns:
    Numeric property value

### getValue

    public int getValue()

  Returns the length in 1/1000ths of a point (millipoints)

  Specified by:
    `getValue` in interface `Length`
  Returns:
    the length in millipoints

### getValue

    public int getValue(PercentBaseContext context)

  Returns the length in 1/1000ths of a point (millipoints)

  Specified by:
    `getValue` in interface `Length`
  Parameters:
    `context` - The context for the length calculation (for percentage based lengths)
  Returns:
    the length in millipoints

### getTableUnits

    public double getTableUnits()

  Return the number of table units which are included in this length specification. This will always be 0 unless the property specification used the proportional-column-width() function (only on table column FOs).

  If this value is not 0, the actual value of the Length cannot be known without looking at all of the columns in the table to determine the value of a "table-unit".

  Returns:
    The number of table units which are included in this length specification.

### toString

    public java.lang.String toString()

  Return a string represention of the expression. Only used for debugging.

  Overrides:
    `toString` in class `Property`
  Returns:
    the string representation.

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.