SimplePercentBaseContext (Apache FOP Core 2.11 API)
Date: 2025-04-24

org.apache.fop.datatypes

## Class SimplePercentBaseContext

- java.lang.Object
- - org.apache.fop.datatypes.SimplePercentBaseContext

- All Implemented Interfaces:
    PercentBaseContext

      public class SimplePercentBaseContext
      extends Object
      implements PercentBaseContext

  Class to implement a simple lookup context for a single percent base value.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimplePercentBaseContext(PercentBaseContext parentContext, int lengthBase, int lengthBaseValue)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getBaseLength(int lengthBase, FObj fobj)` Returns the value for the given lengthBase.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SimplePercentBaseContext

          public SimplePercentBaseContext(PercentBaseContext parentContext,
                                          int lengthBase,
                                          int lengthBaseValue)

      Parameters:
        `parentContext` - the context to be used for all percentages other than lengthBase
        `lengthBase` - the particular percentage length base for which this context provides a value
        `lengthBaseValue` - the value to be returned for requests to the given lengthBase

  - ### Method Detail

    - #### getBaseLength

          public int getBaseLength(int lengthBase,
                                   FObj fobj)

      Returns the value for the given lengthBase. Returns the base length for the given length base. Length base should be one of the constants defined in `LengthBase`.
      Specified by:
        `getBaseLength` in interface `PercentBaseContext`
      Parameters:
        `lengthBase` - Indicates which type of the base length value is to be returned
        `fobj` - The FO object against which the percentage should be evaluated
      Returns:
        The base length value of the given kind

Copyright © 2025 Apache Software Foundation. All rights reserved.