org.optaplanner.core.api.score.holder

## Interface ScoreHolder<Score_ extends Score<Score_>>

- Type Parameters:
    `Score_` - the `Score` type
  All Known Implementing Classes:
    AbstractScoreHolder, BendableBigDecimalScoreHolder, BendableLongScoreHolder, BendableScoreHolder, HardMediumSoftBigDecimalScoreHolder, HardMediumSoftLongScoreHolder, HardMediumSoftScoreHolder, HardSoftBigDecimalScoreHolder, HardSoftDoubleScoreHolder, HardSoftLongScoreHolder, HardSoftScoreHolder, SimpleBigDecimalScoreHolder, SimpleDoubleScoreHolder, SimpleLongScoreHolder, SimpleScoreHolder

      public interface ScoreHolder<Score_ extends Score<Score_>>

  This class is injected as a global by `DroolsScoreDirector` into the Drools DRL. Other `ScoreDirector` implementations do not use this class.

  An implementation must extend `AbstractScoreHolder` to ensure backwards compatibility in future versions.

  See Also:
    `AbstractScoreHolder`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `configureConstraintWeight(org.kie.api.definition.rule.Rule rule, Score_ constraintWeight)` Deprecated. for removal from public API
    `Score_` | `extractScore(int initScore)` Deprecated. for removal from public API, see `ScoreManager`.
    `Map<String,ConstraintMatchTotal>` | `getConstraintMatchTotalMap()` Deprecated. for removal from public API, see `ScoreManager`
    `Collection<ConstraintMatchTotal>` | `getConstraintMatchTotals()` Deprecated. for removal from public API, see `ScoreManager`
    `Map<Object,Indictment>` | `getIndictmentMap()` Deprecated. for removal from public API, see `ScoreManager`
    `boolean` | `isConstraintMatchEnabled()` Deprecated. for removal from public API

- - ### Method Detail

    - #### extractScore

          @Deprecated
          Score_ extractScore(int initScore)

      Deprecated. for removal from public API, see `ScoreManager`.
      Extracts the `Score`, calculated by the `KieSession` for `DroolsScoreDirector`.

      Should not be called directly, use `ScoreDirector.calculateScore()` instead.

      Parameters:
        `initScore` - `<= 0`, managed by OptaPlanner, needed as a parameter in the `Score`'s creation method, see `Score.getInitScore()`
      Returns:
        never null, the `Score` of the working `PlanningSolution`

    - #### configureConstraintWeight

          @Deprecated
          void configureConstraintWeight(org.kie.api.definition.rule.Rule rule,
                                                     Score_ constraintWeight)

      Deprecated. for removal from public API
      Sets up a `ConstraintWeight` from the `ConstraintConfiguration` during initialization.
      Parameters:
        `rule` - never null
        `constraintWeight` - never null, with `Score.getInitScore()` equal to 0.

    - #### isConstraintMatchEnabled

          @Deprecated
          boolean isConstraintMatchEnabled()

      Deprecated. for removal from public API
      Must be in sync with `ScoreDirector.isConstraintMatchEnabled()` for the `ScoreDirector` which contains this `ScoreHolder`.

      Defaults to true.

      Returns:
        false if the `ConstraintMatch`s and `ConstraintMatchTotal`s do not need to be collected which is a performance boost
      See Also:
        `getConstraintMatchTotals()`

    - #### getConstraintMatchTotals

          @Deprecated
          Collection<ConstraintMatchTotal> getConstraintMatchTotals()

      Deprecated. for removal from public API, see `ScoreManager`
      Explains the `Score` of `extractScore(int)`.

      Should not be called directly, use `ScoreDirector.getConstraintMatchTotals()` instead.

      Returns:
        never null
      Throws:
        `IllegalStateException` - if `isConstraintMatchEnabled()` is false
      See Also:
        `ScoreDirector.getConstraintMatchTotals()`

    - #### getConstraintMatchTotalMap

          @Deprecated
          Map<String,ConstraintMatchTotal> getConstraintMatchTotalMap()

      Deprecated. for removal from public API, see `ScoreManager`
      Explains the `Score` of `extractScore(int)`.

      Should not be called directly, use `ScoreDirector.getConstraintMatchTotalMap()` instead.

      Returns:
        never null
      Throws:
        `IllegalStateException` - if `isConstraintMatchEnabled()` is false
      See Also:
        `ScoreDirector.getConstraintMatchTotalMap()`

    - #### getIndictmentMap

          @Deprecated
          Map<Object,Indictment> getIndictmentMap()

      Deprecated. for removal from public API, see `ScoreManager`
      Explains the impact of each planning entity or problem fact on the `Score`.

      Should not be called directly, use `ScoreDirector.getIndictmentMap()` instead.

      Returns:
        never null
      Throws:
        `IllegalStateException` - if `isConstraintMatchEnabled()` returns false
      See Also:
        `ScoreDirector.getIndictmentMap()`

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