Class ConstraintMatchTotal
- java.lang.Object
 - 
- org.optaplanner.core.api.score.constraint.ConstraintMatchTotal
 
 
- 
- All Implemented Interfaces:
 Serializable,Comparable<ConstraintMatchTotal>
public final class ConstraintMatchTotal extends Object implements Serializable, Comparable<ConstraintMatchTotal>
Explains theScoreof aPlanningSolution, from the opposite side thanIndictment. Retrievable fromScoreDirector.getConstraintMatchTotalMap().- See Also:
 - Serialized Form
 
 
- 
- 
Constructor Summary
Constructors Constructor Description ConstraintMatchTotal(String constraintPackage, String constraintName, Score zeroScore)ConstraintMatchTotal(String constraintPackage, String constraintName, Score constraintWeight, Score zeroScore) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ConstraintMatchaddConstraintMatch(List<Object> justificationList, Score score)intcompareTo(ConstraintMatchTotal other)static StringcomposeConstraintId(String constraintPackage, String constraintName)booleanequals(Object o)StringgetConstraintId()To create a constraintId, usecomposeConstraintId(String, String).intgetConstraintMatchCount()Set<ConstraintMatch>getConstraintMatchSet()StringgetConstraintName()StringgetConstraintPackage()ScoregetConstraintWeight()The value of theConstraintWeightannotated member of theConstraintConfiguration.ScoregetScore()Sum of thegetConstraintMatchSet()'sConstraintMatch.getScore().ScoregetScoreTotal()Deprecated.in favor ofgetScore()inthashCode()voidremoveConstraintMatch(ConstraintMatch constraintMatch)StringtoString() 
 - 
 
- 
- 
Constructor Detail
- 
ConstraintMatchTotal
public ConstraintMatchTotal(String constraintPackage, String constraintName, Score zeroScore)
- Parameters:
 constraintPackage- never nullconstraintName- never nullzeroScore- never null
 
- 
ConstraintMatchTotal
public ConstraintMatchTotal(String constraintPackage, String constraintName, Score constraintWeight, Score zeroScore)
- Parameters:
 constraintPackage- never nullconstraintName- never nullconstraintWeight- null ifConstraintWeightisn't used for this constraintzeroScore- never null
 
 - 
 
- 
Method Detail
- 
composeConstraintId
public static String composeConstraintId(String constraintPackage, String constraintName)
- Parameters:
 constraintPackage- never nullconstraintName- never null- Returns:
 - never null
 
 
- 
getConstraintPackage
public String getConstraintPackage()
- Returns:
 - never null
 
 
- 
getConstraintName
public String getConstraintName()
- Returns:
 - never null
 
 
- 
getConstraintWeight
public Score getConstraintWeight()
The value of theConstraintWeightannotated member of theConstraintConfiguration. It's independent to the state of theplanning variables. Do not confuse withgetScore().- Returns:
 - null if 
ConstraintWeightisn't used for this constraint 
 
- 
getConstraintMatchSet
public Set<ConstraintMatch> getConstraintMatchSet()
- Returns:
 - never null
 
 
- 
getConstraintMatchCount
public int getConstraintMatchCount()
- Returns:
 >= 0
 
- 
getScore
public Score getScore()
Sum of thegetConstraintMatchSet()'sConstraintMatch.getScore().- Returns:
 - never null
 
 
- 
getScoreTotal
@Deprecated public Score getScoreTotal()
Deprecated.in favor ofgetScore()- Returns:
 - never null
 
 
- 
addConstraintMatch
public ConstraintMatch addConstraintMatch(List<Object> justificationList, Score score)
 
- 
removeConstraintMatch
public void removeConstraintMatch(ConstraintMatch constraintMatch)
 
- 
getConstraintId
public String getConstraintId()
To create a constraintId, usecomposeConstraintId(String, String).- Returns:
 - never null
 
 
- 
compareTo
public int compareTo(ConstraintMatchTotal other)
- Specified by:
 compareToin interfaceComparable<ConstraintMatchTotal>
 
 - 
 
 -