A - the type of the first matched fact (either a problem fact or a planning entity)B - the type of the second matched fact (either a problem fact or a planning entity)public interface BiConstraintStream<A,B> extends ConstraintStream
ConstraintStream that matches two facts.ConstraintStream| Modifier and Type | Method and Description |
|---|---|
BiConstraintStream<A,B> |
filter(BiPredicate<A,B> predicate)
Exhaustively test each tuple of facts against the
BiPredicate
and match if BiPredicate.test(Object, Object) returns true. |
<GroupKey_> |
groupBy(BiFunction<A,B,GroupKey_> groupKeyMapping) |
<GroupKey_,ResultContainer_,Result_> |
groupBy(BiFunction<A,B,GroupKey_> groupKeyMapping,
BiConstraintCollector<A,B,ResultContainer_,Result_> collector) |
<GroupKeyA_,GroupKeyB_> |
groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping,
BiFunction<A,B,GroupKeyB_> groupKeyBMapping) |
<GroupKeyA_,GroupKeyB_,ResultContainer_,Result_> |
groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping,
BiFunction<A,B,GroupKeyB_> groupKeyBMapping,
BiConstraintCollector<A,B,ResultContainer_,Result_> collector) |
default <C> TriConstraintStream<A,B,C> |
join(Class<C> otherClass)
Create a new
TriConstraintStream for every combination of [A, B] and C. |
default <C> TriConstraintStream<A,B,C> |
join(Class<C> otherClass,
TriJoiner<A,B,C>... joiners)
As defined by
join(Class, TriJoiner). |
default <C> TriConstraintStream<A,B,C> |
join(Class<C> otherClass,
TriJoiner<A,B,C> joiner)
Create a new
TriConstraintStream for every combination of [A, B] and C for which the BiJoiner
is true (for the properties it extracts from both facts). |
default <C> TriConstraintStream<A,B,C> |
join(Class<C> otherClass,
TriJoiner<A,B,C> joiner1,
TriJoiner<A,B,C> joiner2)
As defined by
join(Class, TriJoiner). |
default <C> TriConstraintStream<A,B,C> |
join(Class<C> otherClass,
TriJoiner<A,B,C> joiner1,
TriJoiner<A,B,C> joiner2,
TriJoiner<A,B,C> joiner3)
As defined by
join(Class, TriJoiner). |
default <C> TriConstraintStream<A,B,C> |
join(Class<C> otherClass,
TriJoiner<A,B,C> joiner1,
TriJoiner<A,B,C> joiner2,
TriJoiner<A,B,C> joiner3,
TriJoiner<A,B,C> joiner4)
As defined by
join(Class, TriJoiner). |
default <C> TriConstraintStream<A,B,C> |
join(UniConstraintStream<C> otherStream)
Create a new
TriConstraintStream for every combination of [A, B] and C. |
<C> TriConstraintStream<A,B,C> |
join(UniConstraintStream<C> otherStream,
TriJoiner<A,B,C> joiner)
Create a new
TriConstraintStream for every combination of [A, B] and C for which the BiJoiner
is true (for the properties it extracts from both facts). |
default Constraint |
penalize(String constraintName,
Score<?> constraintWeight,
ToIntBiFunction<A,B> matchWeigher)
Negatively impact the
Score: subtract the constraintWeight multiplied by the match weight. |
Constraint |
penalize(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToIntBiFunction<A,B> matchWeigher)
As defined by
penalize(String, Score, ToIntBiFunction). |
default Constraint |
penalizeBigDecimal(String constraintName,
Score<?> constraintWeight,
BiFunction<A,B,BigDecimal> matchWeigher)
Negatively impact the
Score: subtract the constraintWeight multiplied by the match weight. |
Constraint |
penalizeBigDecimal(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
BiFunction<A,B,BigDecimal> matchWeigher)
As defined by
penalizeBigDecimal(String, Score, BiFunction). |
Constraint |
penalizeConfigurable(String constraintPackage,
String constraintName,
ToIntBiFunction<A,B> matchWeigher)
As defined by
penalizeConfigurable(String, ToIntBiFunction). |
default Constraint |
penalizeConfigurable(String constraintName,
ToIntBiFunction<A,B> matchWeigher)
Negatively impact the
Score: subtract the ConstraintWeight multiplied by the match weight. |
default Constraint |
penalizeConfigurableBigDecimal(String constraintName,
BiFunction<A,B,BigDecimal> matchWeigher)
Negatively impact the
Score: subtract the ConstraintWeight multiplied by the match weight. |
Constraint |
penalizeConfigurableBigDecimal(String constraintPackage,
String constraintName,
BiFunction<A,B,BigDecimal> matchWeigher)
As defined by
penalizeConfigurableBigDecimal(String, BiFunction). |
Constraint |
penalizeConfigurableLong(String constraintPackage,
String constraintName,
ToLongBiFunction<A,B> matchWeigher)
As defined by
penalizeConfigurableLong(String, ToLongBiFunction). |
default Constraint |
penalizeConfigurableLong(String constraintName,
ToLongBiFunction<A,B> matchWeigher)
Negatively impact the
Score: subtract the ConstraintWeight multiplied by the match weight. |
default Constraint |
penalizeLong(String constraintName,
Score<?> constraintWeight,
ToLongBiFunction<A,B> matchWeigher)
Negatively impact the
Score: subtract the constraintWeight multiplied by the match weight. |
Constraint |
penalizeLong(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToLongBiFunction<A,B> matchWeigher)
As defined by
penalizeLong(String, Score, ToLongBiFunction). |
default Constraint |
reward(String constraintName,
Score<?> constraintWeight,
ToIntBiFunction<A,B> matchWeigher)
Positively impact the
Score: add the constraintWeight multiplied by the match weight. |
Constraint |
reward(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToIntBiFunction<A,B> matchWeigher)
As defined by
reward(String, Score, ToIntBiFunction). |
default Constraint |
rewardBigDecimal(String constraintName,
Score<?> constraintWeight,
BiFunction<A,B,BigDecimal> matchWeigher)
Positively impact the
Score: add the constraintWeight multiplied by the match weight. |
Constraint |
rewardBigDecimal(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
BiFunction<A,B,BigDecimal> matchWeigher)
As defined by
rewardBigDecimal(String, Score, BiFunction). |
Constraint |
rewardConfigurable(String constraintPackage,
String constraintName,
ToIntBiFunction<A,B> matchWeigher)
As defined by
rewardConfigurable(String, ToIntBiFunction). |
default Constraint |
rewardConfigurable(String constraintName,
ToIntBiFunction<A,B> matchWeigher)
Positively impact the
Score: add the ConstraintWeight multiplied by the match weight. |
default Constraint |
rewardConfigurableBigDecimal(String constraintName,
BiFunction<A,B,BigDecimal> matchWeigher)
Positively impact the
Score: add the ConstraintWeight multiplied by the match weight. |
Constraint |
rewardConfigurableBigDecimal(String constraintPackage,
String constraintName,
BiFunction<A,B,BigDecimal> matchWeigher)
As defined by
rewardConfigurableBigDecimal(String, BiFunction). |
Constraint |
rewardConfigurableLong(String constraintPackage,
String constraintName,
ToLongBiFunction<A,B> matchWeigher)
As defined by
rewardConfigurableLong(String, ToLongBiFunction). |
default Constraint |
rewardConfigurableLong(String constraintName,
ToLongBiFunction<A,B> matchWeigher)
Positively impact the
Score: add the ConstraintWeight multiplied by the match weight. |
default Constraint |
rewardLong(String constraintName,
Score<?> constraintWeight,
ToLongBiFunction<A,B> matchWeigher)
Positively impact the
Score: add the constraintWeight multiplied by the match weight. |
Constraint |
rewardLong(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToLongBiFunction<A,B> matchWeigher)
As defined by
rewardLong(String, Score, ToLongBiFunction). |
getConstraintFactory, penalize, penalize, penalizeConfigurable, penalizeConfigurable, reward, reward, rewardConfigurable, rewardConfigurableBiConstraintStream<A,B> filter(BiPredicate<A,B> predicate)
BiPredicate
and match if BiPredicate.test(Object, Object) returns true.
Important: This is slower and less scalable than UniConstraintStream#join(UniConstraintStream, BiJoiner[])
with a proper BiJoiner predicate (such as Joiners.equal(Function, Function),
because the latter applies hashing and/or indexing, so it doesn't create every combination just to filter it out.
predicate - never nulldefault <C> TriConstraintStream<A,B,C> join(UniConstraintStream<C> otherStream)
TriConstraintStream for every combination of [A, B] and C.
Important: TriConstraintStream.filter(TriPredicate) Filtering} this is slower and less scalable
than a join(UniConstraintStream, TriJoiner),
because it doesn't apply hashing and/or indexing on the properties,
so it creates and checks every combination of [A, B] and C.
C - the type of the third matched factotherStream - never null<C> TriConstraintStream<A,B,C> join(UniConstraintStream<C> otherStream, TriJoiner<A,B,C> joiner)
TriConstraintStream for every combination of [A, B] and C 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, B] and C.
C - the type of the third matched factotherStream - never nulljoiner - never nullBiJoiner is truedefault <C> TriConstraintStream<A,B,C> join(Class<C> otherClass)
TriConstraintStream for every combination of [A, B] and C.
Important: TriConstraintStream.filter(TriPredicate) Filtering} this is slower and less scalable
than a join(Class, TriJoiner),
because it doesn't apply hashing and/or indexing on the properties,
so it creates and checks every combination of [A, B] and C.
This method is syntactic sugar for join(UniConstraintStream).
C - the type of the third matched factotherClass - never nulldefault <C> TriConstraintStream<A,B,C> join(Class<C> otherClass, TriJoiner<A,B,C> joiner)
TriConstraintStream for every combination of [A, B] and C 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, B] and C.
This method is syntactic sugar for join(UniConstraintStream, TriJoiner).
This method has overloaded methods with multiple TriJoiner parameters.
C - the type of the third matched factotherClass - never nulljoiner - never nullBiJoiner is truedefault <C> TriConstraintStream<A,B,C> join(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2)
join(Class, TriJoiner).C - the type of the third matched factotherClass - never nulljoiner1 - never nulljoiner2 - never nulljoiners are truedefault <C> TriConstraintStream<A,B,C> join(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3)
join(Class, TriJoiner).C - the type of the third matched factotherClass - never nulljoiner1 - never nulljoiner2 - never nulljoiner3 - never nulljoiners are truedefault <C> TriConstraintStream<A,B,C> join(Class<C> otherClass, TriJoiner<A,B,C> joiner1, TriJoiner<A,B,C> joiner2, TriJoiner<A,B,C> joiner3, TriJoiner<A,B,C> joiner4)
join(Class, TriJoiner).C - the type of the third matched factotherClass - never nulljoiner1 - never nulljoiner2 - never nulljoiner3 - never nulljoiner4 - never nulljoiners are truedefault <C> TriConstraintStream<A,B,C> join(Class<C> otherClass, TriJoiner<A,B,C>... joiners)
join(Class, TriJoiner).
This method causes Unchecked generics array creation for varargs parameter warnings,
but we can't fix it with a SafeVarargs annotation because it's an interface method.
Therefore, there are overloaded methods with up to 4 BiJoiner parameters.
C - the type of the third matched factotherClass - never nulljoiners - never nulljoiners are true<GroupKey_> UniConstraintStream<GroupKey_> groupBy(BiFunction<A,B,GroupKey_> groupKeyMapping)
<GroupKey_,ResultContainer_,Result_> BiConstraintStream<GroupKey_,Result_> groupBy(BiFunction<A,B,GroupKey_> groupKeyMapping, BiConstraintCollector<A,B,ResultContainer_,Result_> collector)
<GroupKeyA_,GroupKeyB_> BiConstraintStream<GroupKeyA_,GroupKeyB_> groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping, BiFunction<A,B,GroupKeyB_> groupKeyBMapping)
<GroupKeyA_,GroupKeyB_,ResultContainer_,Result_> TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_> groupBy(BiFunction<A,B,GroupKeyA_> groupKeyAMapping, BiFunction<A,B,GroupKeyB_> groupKeyBMapping, BiConstraintCollector<A,B,ResultContainer_,Result_> collector)
default Constraint penalize(String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)
Score: subtract the constraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.penalize(String, Score).
For non-int Score types use penalizeLong(String, Score, ToLongBiFunction) or penalizeBigDecimal(String, Score, BiFunction) instead.
constraintName - never null, shows up in ConstraintMatchTotal during score justificationconstraintWeight - never nullmatchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint penalize(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)
penalize(String, Score, ToIntBiFunction).constraintPackage - never nullconstraintName - never nullconstraintWeight - never nullmatchWeigher - never nulldefault Constraint penalizeLong(String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)
Score: subtract the constraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.penalize(String, Score).constraintName - never null, shows up in ConstraintMatchTotal during score justificationconstraintWeight - never nullmatchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint penalizeLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)
penalizeLong(String, Score, ToLongBiFunction).constraintPackage - never nullconstraintName - never nullconstraintWeight - never nullmatchWeigher - never nulldefault Constraint penalizeBigDecimal(String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)
Score: subtract the constraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.penalize(String, Score).constraintName - never null, shows up in ConstraintMatchTotal during score justificationconstraintWeight - never nullmatchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint penalizeBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)
penalizeBigDecimal(String, Score, BiFunction).constraintPackage - never nullconstraintName - never nullconstraintWeight - never nullmatchWeigher - never nulldefault Constraint penalizeConfigurable(String constraintName, ToIntBiFunction<A,B> matchWeigher)
Score: subtract the ConstraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.penalizeConfigurable(String).
For non-int Score types use penalizeConfigurableLong(String, ToLongBiFunction) or penalizeConfigurableBigDecimal(String, BiFunction) instead.
constraintName - never null, shows up in ConstraintMatchTotal during score justificationmatchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint penalizeConfigurable(String constraintPackage, String constraintName, ToIntBiFunction<A,B> matchWeigher)
penalizeConfigurable(String, ToIntBiFunction).constraintPackage - never nullconstraintName - never nullmatchWeigher - never nulldefault Constraint penalizeConfigurableLong(String constraintName, ToLongBiFunction<A,B> matchWeigher)
Score: subtract the ConstraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.penalizeConfigurable(String).constraintName - never null, shows up in ConstraintMatchTotal during score justificationmatchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint penalizeConfigurableLong(String constraintPackage, String constraintName, ToLongBiFunction<A,B> matchWeigher)
penalizeConfigurableLong(String, ToLongBiFunction).constraintPackage - never nullconstraintName - never nullmatchWeigher - never nulldefault Constraint penalizeConfigurableBigDecimal(String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)
Score: subtract the ConstraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.penalizeConfigurable(String).constraintName - never null, shows up in ConstraintMatchTotal during score justificationmatchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint penalizeConfigurableBigDecimal(String constraintPackage, String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)
penalizeConfigurableBigDecimal(String, BiFunction).constraintPackage - never nullconstraintName - never nullmatchWeigher - never nulldefault Constraint reward(String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)
Score: add the constraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.reward(String, Score).
For non-int Score types use rewardLong(String, Score, ToLongBiFunction) or rewardBigDecimal(String, Score, BiFunction) instead.
constraintName - never null, shows up in ConstraintMatchTotal during score justificationconstraintWeight - never nullmatchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint reward(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher)
reward(String, Score, ToIntBiFunction).constraintPackage - never nullconstraintName - never nullmatchWeigher - never nulldefault Constraint rewardLong(String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)
Score: add the constraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.reward(String, Score).constraintName - never null, shows up in ConstraintMatchTotal during score justificationconstraintWeight - never nullmatchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint rewardLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher)
rewardLong(String, Score, ToLongBiFunction).constraintPackage - never nullconstraintName - never nullmatchWeigher - never nulldefault Constraint rewardBigDecimal(String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)
Score: add the constraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.reward(String, Score).constraintName - never null, shows up in ConstraintMatchTotal during score justificationconstraintWeight - never nullmatchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint rewardBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher)
rewardBigDecimal(String, Score, BiFunction).constraintPackage - never nullconstraintName - never nullmatchWeigher - never nulldefault Constraint rewardConfigurable(String constraintName, ToIntBiFunction<A,B> matchWeigher)
Score: add the ConstraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.rewardConfigurable(String).
For non-int Score types use rewardConfigurableLong(String, ToLongBiFunction) or rewardConfigurableBigDecimal(String, BiFunction) instead.
constraintName - never null, shows up in ConstraintMatchTotal during score justificationmatchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint rewardConfigurable(String constraintPackage, String constraintName, ToIntBiFunction<A,B> matchWeigher)
rewardConfigurable(String, ToIntBiFunction).constraintPackage - never nullconstraintName - never nullmatchWeigher - never nulldefault Constraint rewardConfigurableLong(String constraintName, ToLongBiFunction<A,B> matchWeigher)
Score: add the ConstraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.rewardConfigurable(String).constraintName - never null, shows up in ConstraintMatchTotal during score justificationmatchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint rewardConfigurableLong(String constraintPackage, String constraintName, ToLongBiFunction<A,B> matchWeigher)
rewardConfigurableLong(String, ToLongBiFunction).constraintPackage - never nullconstraintName - never nullmatchWeigher - never nulldefault Constraint rewardConfigurableBigDecimal(String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)
Score: add the ConstraintWeight multiplied by the match weight.
Otherwise as defined by ConstraintStream.rewardConfigurable(String).constraintName - never null, shows up in ConstraintMatchTotal during score justificationmatchWeigher - never null, the result of this function (matchWeight) is multiplied by the constraintWeightConstraint rewardConfigurableBigDecimal(String constraintPackage, String constraintName, BiFunction<A,B,BigDecimal> matchWeigher)
rewardConfigurableBigDecimal(String, BiFunction).constraintPackage - never nullconstraintName - never nullmatchWeigher - never nullCopyright © 2006–2019 JBoss by Red Hat. All rights reserved.