OptaPlanner core 6.1.0.Beta2

org.optaplanner.core.api.score
Class AbstractScore<S extends Score>

java.lang.Object
  extended by org.optaplanner.core.api.score.AbstractScore<S>
All Implemented Interfaces:
Serializable, Comparable<S>, Score<S>
Direct Known Subclasses:
BendableScore, HardMediumSoftLongScore, HardMediumSoftScore, HardSoftBigDecimalScore, HardSoftDoubleScore, HardSoftLongScore, HardSoftScore, SimpleBigDecimalScore, SimpleDoubleScore, SimpleLongScore, SimpleScore

public abstract class AbstractScore<S extends Score>
extends Object
implements Score<S>, Serializable

Abstract superclass for Score.

Subclasses must be immutable.

See Also:
Score, HardSoftScore, Serialized Form

Constructor Summary
AbstractScore()
           
 
Method Summary
protected static String buildScorePattern(int levelsSize)
           
protected static String buildScorePattern(String... levelSuffixes)
           
 boolean isCompatibleArithmeticArgument(Score otherScore)
           
protected static String[] parseLevelStrings(String scoreString, int levelsSize)
           
protected static String[] parseLevelStrings(String scoreString, String... levelSuffixes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.optaplanner.core.api.score.Score
add, divide, multiply, power, subtract, toLevelNumbers
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

AbstractScore

public AbstractScore()
Method Detail

parseLevelStrings

protected static String[] parseLevelStrings(String scoreString,
                                            int levelsSize)

parseLevelStrings

protected static String[] parseLevelStrings(String scoreString,
                                            String... levelSuffixes)

buildScorePattern

protected static String buildScorePattern(int levelsSize)

buildScorePattern

protected static String buildScorePattern(String... levelSuffixes)

isCompatibleArithmeticArgument

public boolean isCompatibleArithmeticArgument(Score otherScore)
Specified by:
isCompatibleArithmeticArgument in interface Score<S extends Score>
Parameters:
otherScore - never null
Returns:
true if the otherScore is accepted as a parameter of Score.add(Score), Score.subtract(Score) and Comparable.compareTo(Object).

OptaPlanner core 6.1.0.Beta2

Copyright © 2006-2014 JBoss by Red Hat. All Rights Reserved.