public class SimpleScoreDefinition extends AbstractScoreDefinition<SimpleScore>
Constructor and Description |
---|
SimpleScoreDefinition() |
Modifier and Type | Method and Description |
---|---|
SimpleScore |
buildOptimisticBound(InitializingScoreTrend initializingScoreTrend,
SimpleScore score)
|
SimpleScore |
buildPessimisticBound(InitializingScoreTrend initializingScoreTrend,
SimpleScore score)
|
SimpleScoreHolder |
buildScoreHolder(boolean constraintMatchEnabled)
Used by
DroolsScoreDirector . |
SimpleScore |
fromLevelNumbers(Number[] levelNumbers)
The opposite of
Score.toLevelNumbers() . |
int |
getLevelsSize()
Returns the length of
Score.toLevelNumbers() for every Score of this definition. |
Class<SimpleScore> |
getScoreClass()
|
SimpleScore |
parseScore(String scoreString)
|
formatScore, getLevelLabels, toString
public int getLevelsSize()
ScoreDefinition
Score.toLevelNumbers()
for every Score
of this definition.
For example: returns 2 on HardSoftScoreDefinition
.getLevelsSize
in interface ScoreDefinition<SimpleScore>
getLevelsSize
in class AbstractScoreDefinition<SimpleScore>
public Class<SimpleScore> getScoreClass()
ScoreDefinition
Class
of the actual Score
implementation.
For example: returns HardSoftScore.class
on HardSoftScoreDefinition
.public SimpleScore parseScore(String scoreString)
ScoreDefinition
scoreString
- never nullScoreDefinition.formatScore(Score)
public SimpleScore fromLevelNumbers(Number[] levelNumbers)
ScoreDefinition
Score.toLevelNumbers()
.levelNumbers
- never nullpublic SimpleScoreHolder buildScoreHolder(boolean constraintMatchEnabled)
ScoreDefinition
DroolsScoreDirector
.constraintMatchEnabled
- true if ScoreHolder.isConstraintMatchEnabled()
should be truepublic SimpleScore buildOptimisticBound(InitializingScoreTrend initializingScoreTrend, SimpleScore score)
ScoreDefinition
Score
which is equal or better than any other Score
with more variables initialized
(while the already variables don't change).initializingScoreTrend
- never null, with InitializingScoreTrend.getLevelsSize()
equal to ScoreDefinition.getLevelsSize()
.score
- never nullpublic SimpleScore buildPessimisticBound(InitializingScoreTrend initializingScoreTrend, SimpleScore score)
ScoreDefinition
Score
which is equal or worse than any other Score
with more variables initialized
(while the already variables don't change).initializingScoreTrend
- never null, with InitializingScoreTrend.getLevelsSize()
equal to ScoreDefinition.getLevelsSize()
.score
- never nullCopyright © 2006–2016 JBoss by Red Hat. All rights reserved.