Package org.optaplanner.core.api.score
Class AbstractBendableScore<Score_ extends AbstractBendableScore<Score_>>
- java.lang.Object
-
- org.optaplanner.core.api.score.AbstractScore<Score_>
-
- org.optaplanner.core.api.score.AbstractBendableScore<Score_>
-
- All Implemented Interfaces:
Serializable
,Comparable<Score_>
,Score<Score_>
- Direct Known Subclasses:
BendableBigDecimalScore
,BendableLongScore
,BendableScore
public abstract class AbstractBendableScore<Score_ extends AbstractBendableScore<Score_>> extends AbstractScore<Score_>
Abstract superclass for bendableScore
types.Subclasses must be immutable.
- See Also:
BendableScore
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field 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 Description protected
AbstractBendableScore(int initScore)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
buildBendableShortString(Predicate<Number> notZero)
abstract int
getHardLevelsSize()
The sum of this andgetSoftLevelsSize()
equalsgetLevelsSize()
.abstract int
getLevelsSize()
abstract int
getSoftLevelsSize()
The sum ofgetHardLevelsSize()
and this equalsgetLevelsSize()
.protected static String[][]
parseBendableScoreTokens(Class<? extends AbstractBendableScore<?>> scoreClass, String scoreString)
-
Methods inherited from class org.optaplanner.core.api.score.AbstractScore
buildScorePattern, buildShortString, getInitPrefix, getInitScore, isSolutionInitialized, parseInitScore, parseLevelAsBigDecimal, 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 java.lang.Comparable
compareTo
-
Methods inherited from interface org.optaplanner.core.api.score.Score
add, divide, isFeasible, isZero, multiply, negate, power, subtract, toLevelNumbers, toShortString, withInitScore, zero
-
-
-
-
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
- seeScore.getInitScore()
-
-
Method Detail
-
parseBendableScoreTokens
protected static String[][] parseBendableScoreTokens(Class<? extends AbstractBendableScore<?>> scoreClass, String scoreString)
-
getHardLevelsSize
public abstract int getHardLevelsSize()
The sum of this andgetSoftLevelsSize()
equalsgetLevelsSize()
.- Returns:
>= 0
and<
getLevelsSize()
-
getSoftLevelsSize
public abstract int getSoftLevelsSize()
The sum ofgetHardLevelsSize()
and this equalsgetLevelsSize()
.- Returns:
>= 0
and<
getLevelsSize()
-
getLevelsSize
public abstract int getLevelsSize()
- Returns:
getHardLevelsSize()
+getSoftLevelsSize()
-
-