Class DefaultIndictment<Score_ extends Score<Score_>>
- java.lang.Object
-
- org.optaplanner.core.impl.score.constraint.DefaultIndictment<Score_>
-
- All Implemented Interfaces:
Indictment<Score_>
public final class DefaultIndictment<Score_ extends Score<Score_>> extends Object implements Indictment<Score_>
-
-
Constructor Summary
Constructors Constructor Description DefaultIndictment(Object indictedObject, Score_ zeroScore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConstraintMatch(ConstraintMatch<Score_> constraintMatch)
boolean
equals(Object o)
Set<ConstraintMatch<Score_>>
getConstraintMatchSet()
<IndictedObject_>
IndictedObject_getIndictedObject()
The object that was involved in causing the constraints to match.List<ConstraintJustification>
getJustificationList()
RetrieveConstraintJustification
instances associated withConstraintMatch
es inIndictment.getConstraintMatchSet()
.Score_
getScore()
Sum of theIndictment.getConstraintMatchSet()
'sConstraintMatch.getScore()
.int
hashCode()
void
removeConstraintMatch(ConstraintMatch<Score_> constraintMatch)
String
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.Indictment
getConstraintMatchCount, getJustification, getJustificationList
-
-
-
-
Method Detail
-
getIndictedObject
public <IndictedObject_> IndictedObject_ getIndictedObject()
Description copied from interface:Indictment
The object that was involved in causing the constraints to match. It is part ofConstraintMatch.getIndictedObjectList()
of everyConstraintMatch
returned byIndictment.getConstraintMatchSet()
.- Specified by:
getIndictedObject
in interfaceIndictment<Score_ extends Score<Score_>>
- Type Parameters:
IndictedObject_
- Shorthand so that the user does not need to cast in user code.- Returns:
- never null
-
getConstraintMatchSet
public Set<ConstraintMatch<Score_>> getConstraintMatchSet()
- Specified by:
getConstraintMatchSet
in interfaceIndictment<Score_ extends Score<Score_>>
- Returns:
- never null
-
getJustificationList
public List<ConstraintJustification> getJustificationList()
Description copied from interface:Indictment
RetrieveConstraintJustification
instances associated withConstraintMatch
es inIndictment.getConstraintMatchSet()
. This is equivalent to retrievingIndictment.getConstraintMatchSet()
and collecting allConstraintMatch.getJustification()
objects into a list.- Specified by:
getJustificationList
in interfaceIndictment<Score_ extends Score<Score_>>
- Returns:
- never null, guaranteed to contain unique instances
-
getScore
public Score_ getScore()
Description copied from interface:Indictment
Sum of theIndictment.getConstraintMatchSet()
'sConstraintMatch.getScore()
.- Specified by:
getScore
in interfaceIndictment<Score_ extends Score<Score_>>
- Returns:
- never null
-
addConstraintMatch
public void addConstraintMatch(ConstraintMatch<Score_> constraintMatch)
-
removeConstraintMatch
public void removeConstraintMatch(ConstraintMatch<Score_> constraintMatch)
-
-