public final class SimpleScore extends AbstractScore<SimpleScore>
Score is based on 1 level of int constraints.
This class is immutable.
Score,
Serialized Form| Modifier and Type | Method and Description |
|---|---|
SimpleScore |
add(SimpleScore augment)
Returns a Score whose value is (this + augment).
|
int |
compareTo(SimpleScore other) |
SimpleScore |
divide(double divisor)
Returns a Score whose value is (this / divisor).
|
boolean |
equals(Object o) |
int |
getScore()
The total of the broken negative constraints and fulfilled positive hard constraints.
|
int |
hashCode() |
SimpleScore |
multiply(double multiplicand)
Returns a Score whose value is (this * multiplicand).
|
SimpleScore |
negate()
Returns a Score whose value is (- this).
|
static SimpleScore |
parseScore(String scoreString) |
SimpleScore |
power(double exponent)
Returns a Score whose value is (this ^ exponent).
|
SimpleScore |
subtract(SimpleScore subtrahend)
Returns a Score whose value is (this - subtrahend).
|
Number[] |
toLevelNumbers()
Returns an array of numbers representing the Score.
|
String |
toString() |
static SimpleScore |
valueOf(int score) |
buildScorePattern, buildScorePattern, isCompatibleArithmeticArgument, parseLevelAsBigDecimal, parseLevelAsDouble, parseLevelAsInt, parseLevelAsLong, parseLevelStrings, parseLevelStringspublic static SimpleScore parseScore(String scoreString)
public static SimpleScore valueOf(int score)
public int getScore()
public SimpleScore add(SimpleScore augment)
Scoreaugment - value to be added to this Scorepublic SimpleScore subtract(SimpleScore subtrahend)
Scoresubtrahend - value to be subtracted from this Scorepublic SimpleScore 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 SimpleScore 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 SimpleScore 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 SimpleScore 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}
ScoreDefinition.fromLevelNumbers(Number[])public int compareTo(SimpleScore other)
Copyright © 2006–2016 JBoss by Red Hat. All rights reserved.