org.optaplanner.core.impl.score.definition

## Class AbstractBendableScoreDefinition<S extends FeasibilityScore<S>>

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

- All Implemented Interfaces:
    Serializable, FeasibilityScoreDefinition<S>, ScoreDefinition<S>
  Direct Known Subclasses:
    BendableBigDecimalScoreDefinition, BendableLongScoreDefinition, BendableScoreDefinition

      public abstract class AbstractBendableScoreDefinition<S extends FeasibilityScore<S>>
      extends AbstractFeasibilityScoreDefinition<S>

  See Also:
    Serialized Form

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractBendableScoreDefinition(int hardLevelsSize, int softLevelsSize)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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()`

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

      `divide, divide, divide, divide, formatScore, getInitLabel, getLevelLabels, sanitize, 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<S extends FeasibilityScore<S>>`
      Overrides:
        `getLevelsSize` in class `AbstractScoreDefinition<S extends FeasibilityScore<S>>`
      Returns:
        at least 1

    - #### getFeasibleLevelsSize

          public int getFeasibleLevelsSize()

      Description copied from interface: `FeasibilityScoreDefinition`
      Returns the number of levels of `Score.toLevelNumbers()`. that are used to determine `FeasibilityScore.isFeasible()`.
      Returns:
        at least 0, at most `ScoreDefinition.getLevelsSize()`

Copyright © 2006–2020 JBoss by Red Hat. All rights reserved.