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

org.apache.fop.layoutmgr.inline

## Class LineLayoutPossibilities

- java.lang.Object
- - org.apache.fop.layoutmgr.inline.LineLayoutPossibilities

-     public class LineLayoutPossibilities
      extends Object

  Line layout possibilities.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LineLayoutPossibilities()` default constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addBreakPosition(LineLayoutManager.LineBreakPosition pos, int i)`
    `void` | `addPossibility(int ln, double dem)` Add possibility.
    `int` | `applyLineCountAdjustment(int adj)`
    `boolean` | `canUseLessLines()`
    `boolean` | `canUseMoreLines()`
    `double` | `getChosenDemerits()`
    `int` | `getChosenLineCount()`
    `LineLayoutManager.LineBreakPosition` | `getChosenPosition(int i)`
    `double` | `getDemerits(int i)`
    `int` | `getLineCount(int i)`
    `int` | `getMaxLineCount()`
    `int` | `getMinLineCount()`
    `int` | `getOptLineCount()`
    `int` | `getPossibilitiesNumber()`
    `void` | `printAll()` print all
    `void` | `restorePossibilities()` Replace the Possibilities stored in possibilitiesList with the ones stored in savedPossibilities and having the same line number.
    `void` | `savePossibilities(boolean bSaveOptLineCount)` Save in a different array the computed Possibilities, so possibilitiesList is ready to store different Possibilities.

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

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

- - ### Constructor Detail

    - #### LineLayoutPossibilities

          public LineLayoutPossibilities()

      default constructor

  - ### Method Detail

    - #### addPossibility

          public void addPossibility(int ln,
                                     double dem)

      Add possibility.
      Parameters:
        `ln` - line number
        `dem` - demerits

    - #### savePossibilities

          public void savePossibilities(boolean bSaveOptLineCount)

      Save in a different array the computed Possibilities, so possibilitiesList is ready to store different Possibilities.
      Parameters:
        `bSaveOptLineCount` - true if should save optimum line count

    - #### restorePossibilities

          public void restorePossibilities()

      Replace the Possibilities stored in possibilitiesList with the ones stored in savedPossibilities and having the same line number.

    - #### addBreakPosition

          public void addBreakPosition(LineLayoutManager.LineBreakPosition pos,
                                       int i)

      Parameters:
        `pos` - a position
        `i` - an index into posibilities list

    - #### canUseMoreLines

          public boolean canUseMoreLines()

      Returns:
        true if can use more lines

    - #### canUseLessLines

          public boolean canUseLessLines()

      Returns:
        true if can use fewer lines

    - #### getMinLineCount

          public int getMinLineCount()

      Returns:
        the line count of the minimum index

    - #### getOptLineCount

          public int getOptLineCount()

      Returns:
        the line count of the optimum index

    - #### getMaxLineCount

          public int getMaxLineCount()

      Returns:
        the line count of the maximum index

    - #### getChosenLineCount

          public int getChosenLineCount()

      Returns:
        the line count of the chosen index

    - #### getLineCount

          public int getLineCount(int i)

      Parameters:
        `i` - the posibilities list index
      Returns:
        the line count

    - #### getChosenDemerits

          public double getChosenDemerits()

      Returns:
        the demerits of the chosen index

    - #### getDemerits

          public double getDemerits(int i)

      Parameters:
        `i` - the posibilities list index
      Returns:
        the demerits

    - #### getPossibilitiesNumber

          public int getPossibilitiesNumber()

      Returns:
        the possibilities count

    - #### getChosenPosition

          public LineLayoutManager.LineBreakPosition getChosenPosition(int i)

      Parameters:
        `i` - the break position index
      Returns:
        the chosen position

    - #### applyLineCountAdjustment

          public int applyLineCountAdjustment(int adj)

      Parameters:
        `adj` - the adjustment
      Returns:
        the adjustment or zero

    - #### printAll

          public void printAll()

      print all

Copyright © 2025 Apache Software Foundation. All rights reserved.