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