org.optaplanner.core.api.score

## Class AbstractBendableScore<S extends FeasibilityScore<S>>

- java.lang.Object
- - org.optaplanner.core.api.score.AbstractScore<S>
  - - org.optaplanner.core.api.score.AbstractBendableScore<S>

- All Implemented Interfaces:
    Serializable, Comparable<S>, Score<S>
  Direct Known Subclasses:
    BendableBigDecimalScore, BendableLongScore, BendableScore

      public abstract class AbstractBendableScore<S extends FeasibilityScore<S>>
      extends AbstractScore<S>

  Abstract superclass for bendable `Score` types.

  Subclasses must be immutable.

  See Also:
    `BendableScore`, Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static String` | `HARD_LABEL`
    `protected static String[]` | `LEVEL_SUFFIXES`
    `protected static String` | `SOFT_LABEL`

    - ### Fields inherited from class org.optaplanner.core.api.score.AbstractScore

      `INIT_LABEL, initScore`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractBendableScore(int initScore)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `buildBendableShortString(Predicate<Number> notZero)`
    `abstract int` | `getHardLevelsSize()` The sum of this and `getSoftLevelsSize()` equals `getLevelsSize()`.
    `abstract int` | `getLevelsSize()`
    `abstract int` | `getSoftLevelsSize()` The sum of `getHardLevelsSize()` and this equals `getLevelsSize()`.
    `protected static String[][]` | `parseBendableScoreTokens(Class<? extends Score> scoreClass, String scoreString)`

    - ### Methods inherited from class org.optaplanner.core.api.score.AbstractScore

      `assertNoInitScore, buildScorePattern, buildShortString, getInitPrefix, getInitScore, isSolutionInitialized, parseInitScore, parseLevelAsBigDecimal, parseLevelAsDouble, parseLevelAsInt, parseLevelAsLong, parseScoreTokens`

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

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

    - ### Methods inherited from interface org.optaplanner.core.api.score.Score

      `add, divide, isCompatibleArithmeticArgument, isFeasible, multiply, negate, power, subtract, toInitializedScore, toLevelNumbers, toShortString, withInitScore`

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

- - ### Field Detail

    - #### HARD_LABEL

          protected static final String HARD_LABEL

      See Also:
        Constant Field Values

    - #### SOFT_LABEL

          protected static final String SOFT_LABEL

      See Also:
        Constant Field Values

    - #### LEVEL_SUFFIXES

          protected static final String[] LEVEL_SUFFIXES

  - ### Constructor Detail

    - #### AbstractBendableScore

          protected AbstractBendableScore(int initScore)

      Parameters:
        `initScore` - see `Score.getInitScore()`

  - ### Method Detail

    - #### parseBendableScoreTokens

          protected static String[][] parseBendableScoreTokens(Class<? extends Score> scoreClass,
                                                               String scoreString)

    - #### getHardLevelsSize

          public abstract int getHardLevelsSize()

      The sum of this and `getSoftLevelsSize()` equals `getLevelsSize()`.
      Returns:
        `>= 0` and `<` `getLevelsSize()`

    - #### getSoftLevelsSize

          public abstract int getSoftLevelsSize()

      The sum of `getHardLevelsSize()` and this equals `getLevelsSize()`.
      Returns:
        `>= 0` and `<` `getLevelsSize()`

    - #### getLevelsSize

          public abstract int getLevelsSize()

      Returns:
        `getHardLevelsSize()` + `getSoftLevelsSize()`

    - #### buildBendableShortString

          protected String buildBendableShortString(Predicate<Number> notZero)

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