public final class SimpleBigDecimalScore extends AbstractScore<SimpleBigDecimalScore>
Score
,
Serialized FormModifier 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 hard constraints.
|
int |
hashCode() |
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).
|
Number[] |
toLevelNumbers()
Returns an array of numbers representing the Score.
|
String |
toString() |
static SimpleBigDecimalScore |
valueOf(BigDecimal score) |
buildScorePattern, buildScorePattern, isCompatibleArithmeticArgument, parseLevelAsBigDecimal, parseLevelAsDouble, parseLevelAsInt, parseLevelAsLong, parseLevelStrings, parseLevelStrings
public static SimpleBigDecimalScore parseScore(String scoreString)
public static SimpleBigDecimalScore valueOf(BigDecimal score)
public BigDecimal getScore()
public SimpleBigDecimalScore add(SimpleBigDecimalScore augment)
Score
augment
- value to be added to this Scorepublic SimpleBigDecimalScore subtract(SimpleBigDecimalScore subtrahend)
Score
subtrahend
- value to be subtracted from this Scorepublic SimpleBigDecimalScore multiply(double multiplicand)
Score
Math.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)
Score
Math.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)
Score
Math.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()
Score
public 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}
ScoreDefinition.fromLevelNumbers(Number[])
public int compareTo(SimpleBigDecimalScore other)
Copyright © 2006–2016 JBoss by Red Hat. All rights reserved.