Class DefaultConstraintMatchTotal<Score_ extends Score<Score_>>
java.lang.Object
org.optaplanner.core.impl.score.constraint.DefaultConstraintMatchTotal<Score_>
- All Implemented Interfaces:
Comparable<DefaultConstraintMatchTotal<Score_>>
,ConstraintMatchTotal<Score_>
public final class DefaultConstraintMatchTotal<Score_ extends Score<Score_>>
extends Object
implements ConstraintMatchTotal<Score_>, Comparable<DefaultConstraintMatchTotal<Score_>>
-
Constructor Summary
ConstructorDescriptionDefaultConstraintMatchTotal
(String constraintPackage, String constraintName) DefaultConstraintMatchTotal
(String constraintPackage, String constraintName, Score_ constraintWeight) -
Method Summary
Modifier and TypeMethodDescriptionaddConstraintMatch
(List<Object> justifications, Score_ score) Creates aConstraintMatch
and adds it to the collection returned bygetConstraintMatchSet()
.addConstraintMatch
(ConstraintJustification justification, Collection<Object> indictedObjects, Score_ score) Creates aConstraintMatch
and adds it to the collection returned bygetConstraintMatchSet()
.int
boolean
To create a constraintId, useConstraintMatchTotal.composeConstraintId(String, String)
.The value of theConstraintWeight
annotated member of theConstraintConfiguration
.getScore()
int
hashCode()
void
removeConstraintMatch
(ConstraintMatch<Score_> constraintMatch) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.optaplanner.core.api.score.constraint.ConstraintMatchTotal
getConstraintMatchCount
-
Constructor Details
-
DefaultConstraintMatchTotal
-
DefaultConstraintMatchTotal
-
-
Method Details
-
getConstraintPackage
- Specified by:
getConstraintPackage
in interfaceConstraintMatchTotal<Score_ extends Score<Score_>>
- Returns:
- never null
-
getConstraintName
- Specified by:
getConstraintName
in interfaceConstraintMatchTotal<Score_ extends Score<Score_>>
- Returns:
- never null
-
getConstraintWeight
Description copied from interface:ConstraintMatchTotal
The value of theConstraintWeight
annotated member of theConstraintConfiguration
. It's independent to the state of theplanning variables
. Do not confuse withConstraintMatchTotal.getScore()
.- Specified by:
getConstraintWeight
in interfaceConstraintMatchTotal<Score_ extends Score<Score_>>
- Returns:
- null if
ConstraintWeight
isn't used for this constraint
-
getConstraintMatchSet
- Specified by:
getConstraintMatchSet
in interfaceConstraintMatchTotal<Score_ extends Score<Score_>>
- Returns:
- never null
-
getScore
Description copied from interface:ConstraintMatchTotal
- Specified by:
getScore
in interfaceConstraintMatchTotal<Score_ extends Score<Score_>>
- Returns:
- never null
-
addConstraintMatch
Creates aConstraintMatch
and adds it to the collection returned bygetConstraintMatchSet()
. It will useDefaultConstraintJustification
, whoseDefaultConstraintJustification.getFacts()
method will return the given list of justifications. Additionally, the constraint match will indict the objects in the given list of justifications.- Parameters:
justifications
- never null, never emptyscore
- never null- Returns:
- never null
-
addConstraintMatch
public ConstraintMatch<Score_> addConstraintMatch(ConstraintJustification justification, Collection<Object> indictedObjects, Score_ score) Creates aConstraintMatch
and adds it to the collection returned bygetConstraintMatchSet()
. It will the providedConstraintJustification
. Additionally, the constraint match will indict the objects in the given list of indicted objects.- Parameters:
indictedObjects
- never null, may be emptyscore
- never null- Returns:
- never null
-
removeConstraintMatch
-
getConstraintId
Description copied from interface:ConstraintMatchTotal
To create a constraintId, useConstraintMatchTotal.composeConstraintId(String, String)
.- Specified by:
getConstraintId
in interfaceConstraintMatchTotal<Score_ extends Score<Score_>>
- Returns:
- never null
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Score_ extends Score<Score_>>
-
equals
-
hashCode
public int hashCode() -
toString
-