public final class SimpleBigDecimalScore extends AbstractScore<SimpleBigDecimalScore>
Score,
Serialized FormINIT_LABEL, initScore| Modifier and Type | Method and Description |
|---|---|
SimpleBigDecimalScore |
add(SimpleBigDecimalScore augment)
Returns a Score whose value is (this + augment).
|
int |
compareTo(SimpleBigDecimalScore other) |
SimpleBigDecimalScore |
divide(double divisor)
Returns a Score whose value is (this / divisor).
|
boolean |
equals(Object o) |
BigDecimal |
getScore()
The total of the broken negative constraints and fulfilled positive constraints.
|
int |
hashCode() |
boolean |
isCompatibleArithmeticArgument(Score otherScore) |
SimpleBigDecimalScore |
multiply(double multiplicand)
Returns a Score whose value is (this * multiplicand).
|
SimpleBigDecimalScore |
negate()
Returns a Score whose value is (- this).
|
static SimpleBigDecimalScore |
parseScore(String scoreString) |
SimpleBigDecimalScore |
power(double exponent)
Returns a Score whose value is (this ^ exponent).
|
SimpleBigDecimalScore |
subtract(SimpleBigDecimalScore subtrahend)
Returns a Score whose value is (this - subtrahend).
|
SimpleBigDecimalScore |
toInitializedScore()
For example
-7init/0hard/-8soft returns 0hard/-8soft. |
Number[] |
toLevelNumbers()
Returns an array of numbers representing the Score.
|
String |
toString() |
static SimpleBigDecimalScore |
valueOf(int initScore,
BigDecimal score) |
static SimpleBigDecimalScore |
valueOfInitialized(BigDecimal score) |
buildScorePattern, getInitPrefix, getInitScore, isSolutionInitialized, parseInitScore, parseLevelAsBigDecimal, parseLevelAsDouble, parseLevelAsInt, parseLevelAsLong, parseScoreTokenspublic static SimpleBigDecimalScore parseScore(String scoreString)
public static SimpleBigDecimalScore valueOf(int initScore, BigDecimal score)
public static SimpleBigDecimalScore valueOfInitialized(BigDecimal score)
public BigDecimal getScore()
public SimpleBigDecimalScore toInitializedScore()
Score-7init/0hard/-8soft returns 0hard/-8soft.Score.getInitScore() is 0.public SimpleBigDecimalScore add(SimpleBigDecimalScore augment)
Scoreaugment - value to be added to this Scorepublic SimpleBigDecimalScore subtract(SimpleBigDecimalScore subtrahend)
Scoresubtrahend - value to be subtracted from this Scorepublic SimpleBigDecimalScore multiply(double multiplicand)
ScoreMath.floor(double)).
If the implementation has a scale/precision, then the unspecified scale/precision of the double multiplicand should have no impact on the returned scale/precision.
multiplicand - value to be multiplied by this Score.public SimpleBigDecimalScore divide(double divisor)
ScoreMath.floor(double)).
If the implementation has a scale/precision, then the unspecified scale/precision of the double divisor should have no impact on the returned scale/precision.
divisor - value by which this Score is to be dividedpublic SimpleBigDecimalScore power(double exponent)
ScoreMath.floor(double)).
If the implementation has a scale/precision, then the unspecified scale/precision of the double exponent should have no impact on the returned scale/precision.
exponent - value by which this Score is to be poweredpublic SimpleBigDecimalScore negate()
Scorepublic Number[] toLevelNumbers()
Score
When rounding is needed, each rounding should be floored (as defined by Math.floor(double)).
The length of the returned array must be stable for a specific Score implementation.
For example: -0hard/-7soft returns new int{-0, -7}
The level numbers do not contain the Score.getInitScore().
For example: -3init/-0hard/-7soft also returns new int{-0, -7}
ScoreDefinition.fromLevelNumbers(int, Number[])public int compareTo(SimpleBigDecimalScore other)
public boolean isCompatibleArithmeticArgument(Score otherScore)
otherScore - never nullScore.add(Score), Score.subtract(Score)
and Comparable.compareTo(Object).Copyright © 2006–2016 JBoss by Red Hat. All rights reserved.