public abstract class BavetAbstractUniConstraintStream<Solution_,A> extends BavetAbstractConstraintStream<Solution_> implements UniConstraintStream<A>
| Modifier and Type | Field and Description |
|---|---|
protected List<BavetAbstractUniConstraintStream<Solution_,A>> |
childStreamList |
constraintFactory| Constructor and Description |
|---|
BavetAbstractUniConstraintStream(BavetConstraintFactory<Solution_> constraintFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChildStream(BavetAbstractUniConstraintStream<Solution_,A> childStream) |
protected void |
createChildNodeChains(BavetNodeBuildPolicy<Solution_> buildPolicy,
Score<?> constraintWeight,
int nodeOrder,
BavetAbstractUniNode<A> node) |
protected abstract BavetAbstractUniNode<A> |
createNode(BavetNodeBuildPolicy<Solution_> buildPolicy,
Score<?> constraintWeight,
int nodeOrder,
BavetAbstractUniNode<A> parentNode) |
BavetAbstractUniNode<A> |
createNodeChain(BavetNodeBuildPolicy<Solution_> buildPolicy,
Score<?> constraintWeight,
int nodeOrder,
BavetAbstractUniNode<A> parentNode) |
BavetAbstractUniConstraintStream<Solution_,A> |
filter(Predicate<A> predicate)
Exhaustively test each fact against the
Predicate
and match if Predicate.test(Object) returns true. |
<GroupKey_> |
groupBy(Function<A,GroupKey_> groupKeyMapping) |
<GroupKey_,ResultContainer_,Result_> |
groupBy(Function<A,GroupKey_> groupKeyMapping,
UniConstraintCollector<A,ResultContainer_,Result_> collector) |
<GroupKeyA_,GroupKeyB_> |
groupBy(Function<A,GroupKeyA_> groupKeyAMapping,
Function<A,GroupKeyB_> groupKeyBMapping) |
<GroupKeyA_,GroupKeyB_,ResultContainer_,Result_> |
groupBy(Function<A,GroupKeyA_> groupKeyAMapping,
Function<A,GroupKeyB_> groupKeyBMapping,
UniConstraintCollector<A,ResultContainer_,Result_> collector) |
<B> BiConstraintStream<A,B> |
join(UniConstraintStream<B> otherStream,
BiJoiner<A,B> joiner)
Create a new
BiConstraintStream for every combination of A and B for which the BiJoiner
is true (for the properties it extracts from both facts). |
Constraint |
penalize(String constraintPackage,
String constraintName,
Score<?> constraintWeight)
As defined by
ConstraintStream.penalize(String, Score). |
Constraint |
penalize(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToIntFunction<A> matchWeigher)
As defined by
UniConstraintStream.penalize(String, Score, ToIntFunction). |
Constraint |
penalizeBigDecimal(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
Function<A,BigDecimal> matchWeigher)
|
Constraint |
penalizeConfigurable(String constraintPackage,
String constraintName)
As defined by
ConstraintStream.penalizeConfigurable(String). |
Constraint |
penalizeConfigurable(String constraintPackage,
String constraintName,
ToIntFunction<A> matchWeigher)
|
Constraint |
penalizeConfigurableBigDecimal(String constraintPackage,
String constraintName,
Function<A,BigDecimal> matchWeigher)
|
Constraint |
penalizeConfigurableLong(String constraintPackage,
String constraintName,
ToLongFunction<A> matchWeigher)
|
Constraint |
penalizeLong(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToLongFunction<A> matchWeigher)
|
protected BavetAbstractUniNode<A> |
processNode(BavetNodeBuildPolicy<Solution_> buildPolicy,
int nodeOrder,
BavetAbstractUniNode<A> parentNode,
BavetAbstractUniNode<A> node) |
Constraint |
reward(String constraintPackage,
String constraintName,
Score<?> constraintWeight)
As defined by
ConstraintStream.reward(String, Score). |
Constraint |
reward(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToIntFunction<A> matchWeigher)
As defined by
UniConstraintStream.reward(String, Score, ToIntFunction). |
Constraint |
rewardBigDecimal(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
Function<A,BigDecimal> matchWeigher)
|
Constraint |
rewardConfigurable(String constraintPackage,
String constraintName)
As defined by
ConstraintStream.rewardConfigurable(String). |
Constraint |
rewardConfigurable(String constraintPackage,
String constraintName,
ToIntFunction<A> matchWeigher)
|
Constraint |
rewardConfigurableBigDecimal(String constraintPackage,
String constraintName,
Function<A,BigDecimal> matchWeigher)
|
Constraint |
rewardConfigurableLong(String constraintPackage,
String constraintName,
ToLongFunction<A> matchWeigher)
|
Constraint |
rewardLong(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToLongFunction<A> matchWeigher)
|
buildConstraint, buildConstraintConfigurable, buildConstraintWeightExtractor, buildConstraintWeightExtractor, getConstraintFactory, getFromStreamList, validateConstraintIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitjoin, join, join, join, join, join, join, penalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLonggetConstraintFactory, penalize, penalizeConfigurable, reward, rewardConfigurableprotected final List<BavetAbstractUniConstraintStream<Solution_,A>> childStreamList
public BavetAbstractUniConstraintStream(BavetConstraintFactory<Solution_> constraintFactory)
public void addChildStream(BavetAbstractUniConstraintStream<Solution_,A> childStream)
public BavetAbstractUniConstraintStream<Solution_,A> filter(Predicate<A> predicate)
UniConstraintStreamPredicate
and match if Predicate.test(Object) returns true.filter in interface UniConstraintStream<A>predicate - never nullpublic <B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream, BiJoiner<A,B> joiner)
UniConstraintStreamBiConstraintStream for every combination of A and B for which the BiJoiner
is true (for the properties it extracts from both facts).
Important: This is faster and more scalable than a join
followed by a filter,
because it applies hashing and/or indexing on the properties,
so it doesn't create nor checks every combination of A and B.
join in interface UniConstraintStream<A>B - the type of the second matched factotherStream - never nulljoiner - never nullBiJoiner is truepublic <GroupKey_> UniConstraintStream<GroupKey_> groupBy(Function<A,GroupKey_> groupKeyMapping)
groupBy in interface UniConstraintStream<A>public <GroupKey_,ResultContainer_,Result_> BiConstraintStream<GroupKey_,Result_> groupBy(Function<A,GroupKey_> groupKeyMapping, UniConstraintCollector<A,ResultContainer_,Result_> collector)
groupBy in interface UniConstraintStream<A>public <GroupKeyA_,GroupKeyB_> BiConstraintStream<GroupKeyA_,GroupKeyB_> groupBy(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping)
groupBy in interface UniConstraintStream<A>public <GroupKeyA_,GroupKeyB_,ResultContainer_,Result_> TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_> groupBy(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping, UniConstraintCollector<A,ResultContainer_,Result_> collector)
groupBy in interface UniConstraintStream<A>public Constraint penalize(String constraintPackage, String constraintName, Score<?> constraintWeight)
ConstraintStreamConstraintStream.penalize(String, Score).penalize in interface ConstraintStreamconstraintPackage - never nullconstraintName - never nullconstraintWeight - never nullpublic Constraint penalize(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher)
UniConstraintStreamUniConstraintStream.penalize(String, Score, ToIntFunction).penalize in interface UniConstraintStream<A>constraintPackage - never nullconstraintName - never nullconstraintWeight - never nullmatchWeigher - never nullpublic Constraint penalizeLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongFunction<A> matchWeigher)
UniConstraintStreampenalizeLong in interface UniConstraintStream<A>constraintPackage - never nullconstraintName - never nullconstraintWeight - never nullmatchWeigher - never nullpublic Constraint penalizeBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, Function<A,BigDecimal> matchWeigher)
UniConstraintStreampenalizeBigDecimal in interface UniConstraintStream<A>constraintPackage - never nullconstraintName - never nullconstraintWeight - never nullmatchWeigher - never nullpublic Constraint penalizeConfigurable(String constraintPackage, String constraintName)
ConstraintStreamConstraintStream.penalizeConfigurable(String).penalizeConfigurable in interface ConstraintStreamconstraintPackage - never nullconstraintName - never nullpublic Constraint penalizeConfigurable(String constraintPackage, String constraintName, ToIntFunction<A> matchWeigher)
UniConstraintStreampenalizeConfigurable in interface UniConstraintStream<A>constraintPackage - never nullconstraintName - never nullmatchWeigher - never nullpublic Constraint penalizeConfigurableLong(String constraintPackage, String constraintName, ToLongFunction<A> matchWeigher)
UniConstraintStreampenalizeConfigurableLong in interface UniConstraintStream<A>constraintPackage - never nullconstraintName - never nullmatchWeigher - never nullpublic Constraint penalizeConfigurableBigDecimal(String constraintPackage, String constraintName, Function<A,BigDecimal> matchWeigher)
UniConstraintStreampenalizeConfigurableBigDecimal in interface UniConstraintStream<A>constraintPackage - never nullconstraintName - never nullmatchWeigher - never nullpublic Constraint reward(String constraintPackage, String constraintName, Score<?> constraintWeight)
ConstraintStreamConstraintStream.reward(String, Score).reward in interface ConstraintStreamconstraintPackage - never nullconstraintName - never nullconstraintWeight - never nullpublic Constraint reward(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher)
UniConstraintStreamUniConstraintStream.reward(String, Score, ToIntFunction).reward in interface UniConstraintStream<A>constraintPackage - never nullconstraintName - never nullmatchWeigher - never nullpublic Constraint rewardLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongFunction<A> matchWeigher)
UniConstraintStreamrewardLong in interface UniConstraintStream<A>constraintPackage - never nullconstraintName - never nullmatchWeigher - never nullpublic Constraint rewardBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, Function<A,BigDecimal> matchWeigher)
UniConstraintStreamrewardBigDecimal in interface UniConstraintStream<A>constraintPackage - never nullconstraintName - never nullmatchWeigher - never nullpublic Constraint rewardConfigurable(String constraintPackage, String constraintName)
ConstraintStreamConstraintStream.rewardConfigurable(String).rewardConfigurable in interface ConstraintStreamconstraintPackage - never nullconstraintName - never nullpublic Constraint rewardConfigurable(String constraintPackage, String constraintName, ToIntFunction<A> matchWeigher)
UniConstraintStreamrewardConfigurable in interface UniConstraintStream<A>constraintPackage - never nullconstraintName - never nullmatchWeigher - never nullpublic Constraint rewardConfigurableLong(String constraintPackage, String constraintName, ToLongFunction<A> matchWeigher)
UniConstraintStreamrewardConfigurableLong in interface UniConstraintStream<A>constraintPackage - never nullconstraintName - never nullmatchWeigher - never nullpublic Constraint rewardConfigurableBigDecimal(String constraintPackage, String constraintName, Function<A,BigDecimal> matchWeigher)
UniConstraintStreamrewardConfigurableBigDecimal in interface UniConstraintStream<A>constraintPackage - never nullconstraintName - never nullmatchWeigher - never nullpublic BavetAbstractUniNode<A> createNodeChain(BavetNodeBuildPolicy<Solution_> buildPolicy, Score<?> constraintWeight, int nodeOrder, BavetAbstractUniNode<A> parentNode)
protected BavetAbstractUniNode<A> processNode(BavetNodeBuildPolicy<Solution_> buildPolicy, int nodeOrder, BavetAbstractUniNode<A> parentNode, BavetAbstractUniNode<A> node)
protected void createChildNodeChains(BavetNodeBuildPolicy<Solution_> buildPolicy, Score<?> constraintWeight, int nodeOrder, BavetAbstractUniNode<A> node)
protected abstract BavetAbstractUniNode<A> createNode(BavetNodeBuildPolicy<Solution_> buildPolicy, Score<?> constraintWeight, int nodeOrder, BavetAbstractUniNode<A> parentNode)
Copyright © 2006–2019 JBoss by Red Hat. All rights reserved.