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
)C
- the type of the third matched fact (either a problem fact or a planning entity
)D
- the type of the fourth matched fact (either a problem fact or a planning entity
)public interface QuadConstraintStream<A,B,C,D> extends ConstraintStream
ConstraintStream
that matches four facts.ConstraintStream
Modifier and Type | Method and Description |
---|---|
QuadConstraintStream<A,B,C,D> |
filter(QuadPredicate<A,B,C,D> predicate)
Exhaustively test each tuple of facts against the
QuadPredicate
and match if QuadPredicate.test(Object, Object, Object, Object) returns true. |
<ResultContainer_,Result_> |
groupBy(QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
Convert the
QuadConstraintStream to a UniConstraintStream , containing only a single tuple, the
result of applying QuadConstraintCollector . |
<GroupKey_> |
groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping)
Convert the
QuadConstraintStream to a UniConstraintStream , containing the set of tuples resulting
from applying the group key mapping function on all tuples of the original stream. |
<GroupKey_,ResultContainer_,Result_> |
groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping,
QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
Convert the
QuadConstraintStream to a BiConstraintStream , consisting of unique tuples. |
<GroupKeyA_,GroupKeyB_> |
groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping,
QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping)
Convert the
QuadConstraintStream to a BiConstraintStream , consisting of unique tuples. |
<GroupKeyA_,GroupKeyB_,ResultContainer_,Result_> |
groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping,
QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping,
QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
Combines the semantics of
groupBy(QuadFunction, QuadFunction) and
groupBy(QuadConstraintCollector) . |
<GroupKeyA_,GroupKeyB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_> |
groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping,
QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping,
QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC,
QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
Combines the semantics of
groupBy(QuadFunction, QuadFunction) and
groupBy(QuadConstraintCollector) . |
default Constraint |
penalize(String constraintName,
Score<?> constraintWeight,
ToIntQuadFunction<A,B,C,D> matchWeigher)
Negatively impact the
Score : subtract the constraintWeight multiplied by the match weight. |
Constraint |
penalize(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined by
penalize(String, Score, ToIntQuadFunction) . |
default Constraint |
penalizeBigDecimal(String constraintName,
Score<?> constraintWeight,
QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
Negatively impact the
Score : subtract the constraintWeight multiplied by the match weight. |
Constraint |
penalizeBigDecimal(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined by
penalizeBigDecimal(String, Score, QuadFunction) . |
Constraint |
penalizeConfigurable(String constraintPackage,
String constraintName,
ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined by
penalizeConfigurable(String, ToIntQuadFunction) . |
default Constraint |
penalizeConfigurable(String constraintName,
ToIntQuadFunction<A,B,C,D> matchWeigher)
Negatively impact the
Score : subtract the ConstraintWeight multiplied by the match weight. |
default Constraint |
penalizeConfigurableBigDecimal(String constraintName,
QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
Negatively impact the
Score : subtract the ConstraintWeight multiplied by the match weight. |
Constraint |
penalizeConfigurableBigDecimal(String constraintPackage,
String constraintName,
QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined by
penalizeConfigurableBigDecimal(String, QuadFunction) . |
Constraint |
penalizeConfigurableLong(String constraintPackage,
String constraintName,
ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined by
penalizeConfigurableLong(String, ToLongQuadFunction) . |
default Constraint |
penalizeConfigurableLong(String constraintName,
ToLongQuadFunction<A,B,C,D> matchWeigher)
Negatively impact the
Score : subtract the ConstraintWeight multiplied by the match weight. |
default Constraint |
penalizeLong(String constraintName,
Score<?> constraintWeight,
ToLongQuadFunction<A,B,C,D> matchWeigher)
Negatively impact the
Score : subtract the constraintWeight multiplied by the match weight. |
Constraint |
penalizeLong(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined by
penalizeLong(String, Score, ToLongQuadFunction) . |
default Constraint |
reward(String constraintName,
Score<?> constraintWeight,
ToIntQuadFunction<A,B,C,D> matchWeigher)
Positively impact the
Score : add the constraintWeight multiplied by the match weight. |
Constraint |
reward(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined by
reward(String, Score, ToIntQuadFunction) . |
default Constraint |
rewardBigDecimal(String constraintName,
Score<?> constraintWeight,
QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
Positively impact the
Score : add the constraintWeight multiplied by the match weight. |
Constraint |
rewardBigDecimal(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined by
rewardBigDecimal(String, Score, QuadFunction) . |
Constraint |
rewardConfigurable(String constraintPackage,
String constraintName,
ToIntQuadFunction<A,B,C,D> matchWeigher)
As defined by
rewardConfigurable(String, ToIntQuadFunction) . |
default Constraint |
rewardConfigurable(String constraintName,
ToIntQuadFunction<A,B,C,D> matchWeigher)
Positively impact the
Score : add the ConstraintWeight multiplied by the match weight. |
default Constraint |
rewardConfigurableBigDecimal(String constraintName,
QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
Positively impact the
Score : add the ConstraintWeight multiplied by the match weight. |
Constraint |
rewardConfigurableBigDecimal(String constraintPackage,
String constraintName,
QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
As defined by
rewardConfigurableBigDecimal(String, QuadFunction) . |
Constraint |
rewardConfigurableLong(String constraintPackage,
String constraintName,
ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined by
rewardConfigurableLong(String, ToLongQuadFunction) . |
default Constraint |
rewardConfigurableLong(String constraintName,
ToLongQuadFunction<A,B,C,D> matchWeigher)
Positively impact the
Score : add the ConstraintWeight multiplied by the match weight. |
default Constraint |
rewardLong(String constraintName,
Score<?> constraintWeight,
ToLongQuadFunction<A,B,C,D> matchWeigher)
Positively impact the
Score : add the constraintWeight multiplied by the match weight. |
Constraint |
rewardLong(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToLongQuadFunction<A,B,C,D> matchWeigher)
As defined by
rewardLong(String, Score, ToLongQuadFunction) . |
getConstraintFactory, penalize, penalize, penalizeConfigurable, penalizeConfigurable, reward, reward, rewardConfigurable, rewardConfigurable
QuadConstraintStream<A,B,C,D> filter(QuadPredicate<A,B,C,D> predicate)
QuadPredicate
and match if QuadPredicate.test(Object, Object, Object, Object)
returns true.
Important: This is slower and less scalable than
TriConstraintStream.join(UniConstraintStream, QuadJoiner)
with a proper QuadJoiner
predicate
(such as Joiners.equal(TriFunction, Function)
,
because the latter applies hashing and/or indexing, so it doesn't create every combination just to filter it out.
predicate
- never null<ResultContainer_,Result_> UniConstraintStream<Result_> groupBy(QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
QuadConstraintStream
to a UniConstraintStream
, containing only a single tuple, the
result of applying QuadConstraintCollector
.
UniConstraintStream
which only has a single tuple, the result of applying
QuadConstraintCollector
.ResultContainer_
- the mutable accumulation type (often hidden as an implementation detail)Result_
- the type of a fact in the destination UniConstraintStream
's tuplecollector
- never null, the collector to perform the grouping operation with<GroupKey_> UniConstraintStream<GroupKey_> groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping)
QuadConstraintStream
to a UniConstraintStream
, containing the set of tuples resulting
from applying the group key mapping function on all tuples of the original stream.
Neither tuple of the new stream Objects.equals(Object, Object)
any other.GroupKey_
- the type of a fact in the destination UniConstraintStream
's tuplegroupKeyMapping
- never null, mapping function to convert each element in the stream to a different element<GroupKey_,ResultContainer_,Result_> BiConstraintStream<GroupKey_,Result_> groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping, QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
QuadConstraintStream
to a BiConstraintStream
, consisting of unique tuples.
The first fact is the return value of the first group key mapping function, applied on the incoming tuple.
The second fact is the return value of a given QuadConstraintCollector
applied on all incoming tuples
with the same first fact.
GroupKey_
- the type of the first fact in the destination BiConstraintStream
's tupleResultContainer_
- the mutable accumulation type (often hidden as an implementation detail)Result_
- the type of the second fact in the destination BiConstraintStream
's tuplegroupKeyMapping
- never null, function to convert the fact in the original tuple to a different fact<GroupKeyA_,GroupKeyB_> BiConstraintStream<GroupKeyA_,GroupKeyB_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping)
QuadConstraintStream
to a BiConstraintStream
, consisting of unique tuples.
The first fact is the return value of the first group key mapping function, applied on the incoming tuple. The second fact is the return value of the second group key mapping function, applied on all incoming tuples with the same first fact.
GroupKeyA_
- the type of the first fact in the destination BiConstraintStream
's tupleGroupKeyB_
- the type of the second fact in the destination BiConstraintStream
's tuplegroupKeyAMapping
- never null, function to convert the facts in the original tuple to a new factgroupKeyBMapping
- never null, function to convert the facts in the original tuple to another new fact<GroupKeyA_,GroupKeyB_,ResultContainer_,Result_> TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
groupBy(QuadFunction, QuadFunction)
and
groupBy(QuadConstraintCollector)
.
That is, the first and second facts in the tuple follow the groupBy(QuadFunction, QuadFunction)
semantics,
and the third fact is the result of applying QuadConstraintCollector.finisher()
on all the tuples of the
original UniConstraintStream
that belong to the group.GroupKeyA_
- the type of the first fact in the destination TriConstraintStream
's tupleGroupKeyB_
- the type of the second fact in the destination TriConstraintStream
's tupleResultContainer_
- the mutable accumulation type (often hidden as an implementation detail)Result_
- the type of the third fact in the destination TriConstraintStream
's tuplegroupKeyAMapping
- never null, function to convert the original tuple into a first factgroupKeyBMapping
- never null, function to convert the original tuple into a second factcollector
- never null, the collector to perform the grouping operation with<GroupKeyA_,GroupKeyB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_> QuadConstraintStream<GroupKeyA_,GroupKeyB_,ResultC_,ResultD_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
groupBy(QuadFunction, QuadFunction)
and
groupBy(QuadConstraintCollector)
.
That is, the first and second facts in the tuple follow the groupBy(QuadFunction, QuadFunction)
semantics.
The third fact is the result of applying the first QuadConstraintCollector.finisher()
on all the tuples
of the original QuadConstraintStream
that belong to the group.
The fourth fact is the result of applying the second QuadConstraintCollector.finisher()
on all the tuples
of the original QuadConstraintStream
that belong to the groupGroupKeyA_
- the type of the first fact in the destination QuadConstraintStream
's tupleGroupKeyB_
- the type of the second fact in the destination QuadConstraintStream
's tupleResultContainerC_
- the mutable accumulation type (often hidden as an implementation detail)ResultC_
- the type of the third fact in the destination QuadConstraintStream
's tupleResultContainerD_
- the mutable accumulation type (often hidden as an implementation detail)ResultD_
- the type of the fourth fact in the destination QuadConstraintStream
's tuplegroupKeyAMapping
- never null, function to convert the original tuple into a first factgroupKeyBMapping
- never null, function to convert the original tuple into a second factcollectorC
- never null, the collector to perform the first grouping operation withcollectorD
- never null, the collector to perform the first grouping operation withdefault Constraint penalize(String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> 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, ToLongQuadFunction)
or
penalizeBigDecimal(String, Score, QuadFunction)
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, ToIntQuadFunction<A,B,C,D> matchWeigher)
penalize(String, Score, ToIntQuadFunction)
.constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- never nullmatchWeigher
- never nulldefault Constraint penalizeLong(String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> 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, ToLongQuadFunction<A,B,C,D> matchWeigher)
penalizeLong(String, Score, ToLongQuadFunction)
.constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- never nullmatchWeigher
- never nulldefault Constraint penalizeBigDecimal(String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,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, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
penalizeBigDecimal(String, Score, QuadFunction)
.constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- never nullmatchWeigher
- never nulldefault Constraint penalizeConfigurable(String constraintName, ToIntQuadFunction<A,B,C,D> 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, ToLongQuadFunction)
or
penalizeConfigurableBigDecimal(String, QuadFunction)
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, ToIntQuadFunction<A,B,C,D> matchWeigher)
penalizeConfigurable(String, ToIntQuadFunction)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint penalizeConfigurableLong(String constraintName, ToLongQuadFunction<A,B,C,D> 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, ToLongQuadFunction<A,B,C,D> matchWeigher)
penalizeConfigurableLong(String, ToLongQuadFunction)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint penalizeConfigurableBigDecimal(String constraintName, QuadFunction<A,B,C,D,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, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
penalizeConfigurableBigDecimal(String, QuadFunction)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint reward(String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> 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, ToLongQuadFunction)
or
rewardBigDecimal(String, Score, QuadFunction)
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, ToIntQuadFunction<A,B,C,D> matchWeigher)
reward(String, Score, ToIntQuadFunction)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint rewardLong(String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> 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, ToLongQuadFunction<A,B,C,D> matchWeigher)
rewardLong(String, Score, ToLongQuadFunction)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint rewardBigDecimal(String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,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, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
rewardBigDecimal(String, Score, QuadFunction)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint rewardConfigurable(String constraintName, ToIntQuadFunction<A,B,C,D> 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, ToLongQuadFunction)
or
rewardConfigurableBigDecimal(String, QuadFunction)
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, ToIntQuadFunction<A,B,C,D> matchWeigher)
rewardConfigurable(String, ToIntQuadFunction)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint rewardConfigurableLong(String constraintName, ToLongQuadFunction<A,B,C,D> 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, ToLongQuadFunction<A,B,C,D> matchWeigher)
rewardConfigurableLong(String, ToLongQuadFunction)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nulldefault Constraint rewardConfigurableBigDecimal(String constraintName, QuadFunction<A,B,C,D,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, QuadFunction<A,B,C,D,BigDecimal> matchWeigher)
rewardConfigurableBigDecimal(String, QuadFunction)
.constraintPackage
- never nullconstraintName
- never nullmatchWeigher
- never nullCopyright © 2006–2020 JBoss by Red Hat. All rights reserved.