Package org.optaplanner.core.impl.score.definition

## Class AbstractBendableScoreDefinition<Score_ extends Score<Score_>>

- java.lang.Object
- - org.optaplanner.core.impl.score.definition.AbstractScoreDefinition<Score_>
  - - org.optaplanner.core.impl.score.definition.AbstractBendableScoreDefinition<Score_>

- All Implemented Interfaces:
    `ScoreDefinition<Score_>`
  Direct Known Subclasses:
    `BendableBigDecimalScoreDefinition`, `BendableLongScoreDefinition`, `BendableScoreDefinition`

      public abstract class AbstractBendableScoreDefinition<Score_ extends Score<Score_>>
      extends AbstractScoreDefinition<Score_>
      implements ScoreDefinition<Score_>

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected int` | `hardLevelsSize` |
    `protected int` | `softLevelsSize` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AbstractBendableScoreDefinition​(int hardLevelsSize, int softLevelsSize)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected static String[]` | `generateLevelLabels​(int hardLevelsSize, int softLevelsSize)` |
    `int` | `getFeasibleLevelsSize()` | Returns the number of levels of `Score.toLevelNumbers()`.
    `int` | `getHardLevelsSize()` |
    `int` | `getLevelsSize()` | Returns the length of `Score.toLevelNumbers()` for every `Score` of this definition.
    `int` | `getSoftLevelsSize()` |
    `boolean` | `isCompatibleArithmeticArgument​(Score score)` |

    - ### Methods inherited from class org.optaplanner.core.impl.score.definition.AbstractScoreDefinition

      `divide, divide, divide, divide, formatScore, getInitLabel, getLevelLabels, sanitize, sanitize, sanitize, toString`

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

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

    - ### Methods inherited from interface org.optaplanner.core.impl.score.definition.ScoreDefinition

      `buildOptimisticBound, buildPessimisticBound, buildScoreHolder, buildScoreInliner, divideBySanitizedDivisor, formatScore, fromLevelNumbers, getInitLabel, getLevelLabels, getOneSoftestScore, getScoreClass, getZeroScore, isNegativeOrZero, isPositiveOrZero, parseScore`

- - ### Field Detail

    - #### hardLevelsSize

          protected final int hardLevelsSize

    - #### softLevelsSize

          protected final int softLevelsSize

  - ### Constructor Detail

    - #### AbstractBendableScoreDefinition

          public AbstractBendableScoreDefinition​(int hardLevelsSize,
                                                 int softLevelsSize)

  - ### Method Detail

    - #### generateLevelLabels

          protected static String[] generateLevelLabels​(int hardLevelsSize,
                                                        int softLevelsSize)

    - #### getHardLevelsSize

          public int getHardLevelsSize()

    - #### getSoftLevelsSize

          public int getSoftLevelsSize()

    - #### getLevelsSize

          public int getLevelsSize()

      Description copied from interface: `ScoreDefinition`
      Returns the length of `Score.toLevelNumbers()` for every `Score` of this definition. For example: returns 2 on `HardSoftScoreDefinition`.
      Specified by:
        `getLevelsSize` in interface `ScoreDefinition<Score_ extends Score<Score_>>`
      Overrides:
        `getLevelsSize` in class `AbstractScoreDefinition<Score_ extends Score<Score_>>`
      Returns:
        at least 1

    - #### getFeasibleLevelsSize

          public int getFeasibleLevelsSize()

      Description copied from interface: `ScoreDefinition`
      Returns the number of levels of `Score.toLevelNumbers()`. that are used to determine `Score.isFeasible()`.
      Specified by:
        `getFeasibleLevelsSize` in interface `ScoreDefinition<Score_ extends Score<Score_>>`
      Returns:
        at least 0, at most `ScoreDefinition.getLevelsSize()`

    - #### isCompatibleArithmeticArgument

          public boolean isCompatibleArithmeticArgument​(Score score)

      Specified by:
        `isCompatibleArithmeticArgument` in interface `ScoreDefinition<Score_ extends Score<Score_>>`
      Overrides:
        `isCompatibleArithmeticArgument` in class `AbstractScoreDefinition<Score_ extends Score<Score_>>`
      Parameters:
        `score` - never null
      Returns:
        true if the otherScore is accepted as a parameter of `Score.add(Score)`, `Score.subtract(Score)` and `Comparable.compareTo(Object)` for scores of this score definition.