public abstract class AbstractConstraint<Solution_,ConstraintFactory extends InnerConstraintFactory<Solution_>> extends Object implements Constraint
| Modifier and Type | Field and Description |
|---|---|
protected ConstraintFactory |
constraintFactory |
protected String |
constraintName |
protected String |
constraintPackage |
protected ScoreImpactType |
scoreImpactType |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractConstraint(ConstraintFactory constraintFactory,
String constraintPackage,
String constraintName,
Function<Solution_,Score<?>> constraintWeightExtractor,
ScoreImpactType scoreImpactType) |
| Modifier and Type | Method and Description |
|---|---|
void |
assertCorrectImpact(BigDecimal impact) |
void |
assertCorrectImpact(int impact) |
void |
assertCorrectImpact(long impact) |
Score<?> |
extractConstraintWeight(Solution_ workingSolution) |
ConstraintFactory |
getConstraintFactory()
The
ConstraintFactory that build this. |
String |
getConstraintName()
The constraint name.
|
String |
getConstraintPackage()
The constraint package is the namespace of the constraint.
|
ScoreImpactType |
getScoreImpactType() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConstraintIdprotected final ConstraintFactory extends InnerConstraintFactory<Solution_> constraintFactory
protected final String constraintPackage
protected final String constraintName
protected final ScoreImpactType scoreImpactType
protected AbstractConstraint(ConstraintFactory constraintFactory, String constraintPackage, String constraintName, Function<Solution_,Score<?>> constraintWeightExtractor, ScoreImpactType scoreImpactType)
public void assertCorrectImpact(int impact)
public void assertCorrectImpact(long impact)
public void assertCorrectImpact(BigDecimal impact)
public ConstraintFactory getConstraintFactory()
ConstraintConstraintFactory that build this.getConstraintFactory in interface Constraintpublic String getConstraintPackage()
Constraint
When using a ConstraintConfiguration,
it is equal to the ConstraintWeight.constraintPackage().
getConstraintPackage in interface Constraintpublic String getConstraintName()
ConstraintConstraint.getConstraintId() is unique.
When using a ConstraintConfiguration,
it is equal to the ConstraintWeight.value().
getConstraintName in interface Constraintpublic ScoreImpactType getScoreImpactType()
Copyright © 2006–2020 JBoss by Red Hat. All rights reserved.