Class DroolsAbstractQuadConstraintStream<Solution_,A,B,C,D>
- java.lang.Object
-
- org.optaplanner.core.impl.score.stream.common.AbstractConstraintStream<Solution_>
-
- org.optaplanner.core.impl.score.stream.drools.common.DroolsAbstractConstraintStream<Solution_>
-
- org.optaplanner.core.impl.score.stream.drools.quad.DroolsAbstractQuadConstraintStream<Solution_,A,B,C,D>
-
- All Implemented Interfaces:
ConstraintStream
,QuadConstraintStream<A,B,C,D>
,InnerQuadConstraintStream<A,B,C,D>
- Direct Known Subclasses:
DroolsExistsQuadConstraintStream
,DroolsFilterQuadConstraintStream
,DroolsFlatteningQuadConstraintStream
,DroolsGroupingQuadConstraintStream
,DroolsJoinQuadConstraintStream
public abstract class DroolsAbstractQuadConstraintStream<Solution_,A,B,C,D> extends DroolsAbstractConstraintStream<Solution_> implements InnerQuadConstraintStream<A,B,C,D>
-
-
Field Summary
-
Fields inherited from class org.optaplanner.core.impl.score.stream.drools.common.DroolsAbstractConstraintStream
constraintFactory
-
-
Constructor Summary
Constructors Constructor Description DroolsAbstractQuadConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory, RetrievalSemantics retrievalSemantics)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description QuadConstraintStream<A,B,C,D>
filter(QuadPredicate<A,B,C,D> predicate)
Exhaustively test each tuple of facts against theQuadPredicate
and match ifQuadPredicate.test(Object, Object, Object, Object)
returns true.<ResultD_> QuadConstraintStream<A,B,C,ResultD_>
flattenLast(Function<D,Iterable<ResultD_>> mapping)
As defined byBiConstraintStream.flattenLast(Function)
.abstract QuadLeftHandSide<A,B,C,D>
getLeftHandSide()
<GroupKey_>
UniConstraintStream<GroupKey_>groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping)
Convert theQuadConstraintStream
to aUniConstraintStream
, containing the set of tuples resulting from applying the group key mapping function on all tuples of the original stream.<GroupKey_,ResultContainer_,Result_>
BiConstraintStream<GroupKey_,Result_>groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping, QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
Convert theQuadConstraintStream
to aBiConstraintStream
, consisting of unique tuples.<GroupKey_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_>
TriConstraintStream<GroupKey_,ResultB_,ResultC_>groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC)
Convert theQuadConstraintStream
to aTriConstraintStream
, consisting of unique tuples with three facts.<GroupKey_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_>
QuadConstraintStream<GroupKey_,ResultB_,ResultC_,ResultD_>groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
Convert theQuadConstraintStream
to aQuadConstraintStream
, consisting of unique tuples with four facts.<GroupKeyA_,GroupKeyB_>
BiConstraintStream<GroupKeyA_,GroupKeyB_>groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping)
Convert theQuadConstraintStream
to aBiConstraintStream
, consisting of unique tuples.<GroupKeyA_,GroupKeyB_,GroupKeyC_>
TriConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_>groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadFunction<A,B,C,D,GroupKeyC_> groupKeyCMapping)
Convert theQuadConstraintStream
to aTriConstraintStream
, consisting of unique tuples with three facts.<GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_>groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadFunction<A,B,C,D,GroupKeyC_> groupKeyCMapping, QuadFunction<A,B,C,D,GroupKeyD_> groupKeyDMapping)
Convert theTriConstraintStream
to aQuadConstraintStream
, consisting of unique tuples with four facts.<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultContainerD_,ResultD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultD_>groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadFunction<A,B,C,D,GroupKeyC_> groupKeyCMapping, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
Combines the semantics ofQuadConstraintStream.groupBy(QuadFunction, QuadFunction)
andQuadConstraintStream.groupBy(QuadConstraintCollector)
.<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)
Combines the semantics ofQuadConstraintStream.groupBy(QuadFunction, QuadFunction)
andQuadConstraintStream.groupBy(QuadConstraintCollector)
.<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)
Combines the semantics ofQuadConstraintStream.groupBy(QuadFunction, QuadFunction)
andQuadConstraintStream.groupBy(QuadConstraintCollector)
.<ResultContainer_,Result_>
UniConstraintStream<Result_>groupBy(QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
Convert theQuadConstraintStream
to aUniConstraintStream
, containing only a single tuple, the result of applyingQuadConstraintCollector
.<ResultContainerA_,ResultA_,ResultContainerB_,ResultB_>
BiConstraintStream<ResultA_,ResultB_>groupBy(QuadConstraintCollector<A,B,C,D,ResultContainerA_,ResultA_> collectorA, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB)
Convert theQuadConstraintStream
to aBiConstraintStream
, containing only a single tuple, the result of applying twoQuadConstraintCollector
s.<ResultContainerA_,ResultA_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_>
TriConstraintStream<ResultA_,ResultB_,ResultC_>groupBy(QuadConstraintCollector<A,B,C,D,ResultContainerA_,ResultA_> collectorA, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC)
Convert theQuadConstraintStream
to aTriConstraintStream
, containing only a single tuple, the result of applying threeQuadConstraintCollector
s.<ResultContainerA_,ResultA_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_>
QuadConstraintStream<ResultA_,ResultB_,ResultC_,ResultD_>groupBy(QuadConstraintCollector<A,B,C,D,ResultContainerA_,ResultA_> collectorA, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
Convert theQuadConstraintStream
to aQuadConstraintStream
, containing only a single tuple, the result of applying fourQuadConstraintCollector
s.<E> QuadConstraintStream<A,B,C,D>
ifExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
As defined byQuadConstraintStream.ifExists(Class, PentaJoiner)
.<E> QuadConstraintStream<A,B,C,D>
ifExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
<E> QuadConstraintStream<A,B,C,D>
ifNotExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
As defined byQuadConstraintStream.ifNotExists(Class, PentaJoiner)
.<E> QuadConstraintStream<A,B,C,D>
ifNotExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
Constraint
impactScore(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> matchWeigher, ScoreImpactType impactType)
protected Constraint
impactScore(String constraintPackage, String constraintName, Score<?> constraintWeight, ScoreImpactType impactType)
Constraint
impactScoreBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,BigDecimal> matchWeigher, ScoreImpactType impactType)
Constraint
impactScoreConfigurable(String constraintPackage, String constraintName, ToIntQuadFunction<A,B,C,D> matchWeigher, ScoreImpactType impactType)
protected Constraint
impactScoreConfigurable(String constraintPackage, String constraintName, ScoreImpactType impactType)
Constraint
impactScoreConfigurableBigDecimal(String constraintPackage, String constraintName, QuadFunction<A,B,C,D,BigDecimal> matchWeigher, ScoreImpactType impactType)
Constraint
impactScoreConfigurableLong(String constraintPackage, String constraintName, ToLongQuadFunction<A,B,C,D> matchWeigher, ScoreImpactType impactType)
Constraint
impactScoreLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> matchWeigher, ScoreImpactType impactType)
<ResultA_> UniConstraintStream<ResultA_>
map(QuadFunction<A,B,C,D,ResultA_> mapping)
As defined byUniConstraintStream.map(Function)
.-
Methods inherited from class org.optaplanner.core.impl.score.stream.drools.common.DroolsAbstractConstraintStream
addChildStream, buildConstraint, buildConstraintConfigurable, getChildStreams, getConstraintFactory
-
Methods inherited from class org.optaplanner.core.impl.score.stream.common.AbstractConstraintStream
buildConstraintWeightExtractor, buildConstraintWeightExtractor, getRetrievalSemantics, impact, penalize, penalizeConfigurable, reward, rewardConfigurable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.optaplanner.core.api.score.stream.ConstraintStream
getConstraintFactory, impact, impact, penalize, penalize, penalizeConfigurable, penalizeConfigurable, reward, reward, rewardConfigurable, rewardConfigurable
-
Methods inherited from interface org.optaplanner.core.impl.score.stream.quad.InnerQuadConstraintStream
distinct, guaranteesDistinct, impact, impactBigDecimal, impactConfigurable, impactConfigurableBigDecimal, impactConfigurableLong, impactLong, penalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLong
-
Methods inherited from interface org.optaplanner.core.api.score.stream.quad.QuadConstraintStream
ifExists, ifExists, ifExists, ifExists, ifExistsIncludingNullVars, ifExistsIncludingNullVars, ifExistsIncludingNullVars, ifExistsIncludingNullVars, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExistsIncludingNullVars, ifNotExistsIncludingNullVars, ifNotExistsIncludingNullVars, ifNotExistsIncludingNullVars, impact, impactBigDecimal, impactConfigurable, impactConfigurableBigDecimal, impactConfigurableLong, impactLong, penalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLong
-
-
-
-
Constructor Detail
-
DroolsAbstractQuadConstraintStream
public DroolsAbstractQuadConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory, RetrievalSemantics retrievalSemantics)
-
-
Method Detail
-
filter
public QuadConstraintStream<A,B,C,D> filter(QuadPredicate<A,B,C,D> predicate)
Description copied from interface:QuadConstraintStream
Exhaustively test each tuple of facts against theQuadPredicate
and match ifQuadPredicate.test(Object, Object, Object, Object)
returns true.Important: This is slower and less scalable than
TriConstraintStream.join(UniConstraintStream, QuadJoiner)
with a properQuadJoiner
predicate (such asJoiners.equal(TriFunction, Function)
, because the latter applies hashing and/or indexing, so it doesn't create every combination just to filter it out.
-
ifExists
@SafeVarargs public final <E> QuadConstraintStream<A,B,C,D> ifExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
Description copied from interface:QuadConstraintStream
As defined byQuadConstraintStream.ifExists(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.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 4PentaJoiner
parameters.- Specified by:
ifExists
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiners
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E exists for which the
PentaJoiner
s are true
-
ifExistsIncludingNullVars
@SafeVarargs public final <E> QuadConstraintStream<A,B,C,D> ifExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
Description copied from interface:QuadConstraintStream
As defined byQuadConstraintStream.ifExistsIncludingNullVars(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.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 4PentaJoiner
parameters.- Specified by:
ifExistsIncludingNullVars
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiners
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E exists for which the
PentaJoiner
s are true
-
ifNotExists
@SafeVarargs public final <E> QuadConstraintStream<A,B,C,D> ifNotExists(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
Description copied from interface:QuadConstraintStream
As defined byQuadConstraintStream.ifNotExists(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.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 4PentaJoiner
parameters.- Specified by:
ifNotExists
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiners
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E does not exist for which the
PentaJoiner
s are true
-
ifNotExistsIncludingNullVars
@SafeVarargs public final <E> QuadConstraintStream<A,B,C,D> ifNotExistsIncludingNullVars(Class<E> otherClass, PentaJoiner<A,B,C,D,E>... joiners)
Description copied from interface:QuadConstraintStream
As defined byQuadConstraintStream.ifNotExistsIncludingNullVars(Class, PentaJoiner)
. For performance reasons, indexing joiners must be placed before filtering joiners.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 4PentaJoiner
parameters.- Specified by:
ifNotExistsIncludingNullVars
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
E
- the type of the fifth matched fact- Parameters:
otherClass
- never nulljoiners
- never null- Returns:
- never null, a stream that matches every tuple of A, B, C and D where E does not exist for which the
PentaJoiner
s are true
-
groupBy
public <ResultContainer_,Result_> UniConstraintStream<Result_> groupBy(QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
Description copied from interface:QuadConstraintStream
Convert theQuadConstraintStream
to aUniConstraintStream
, containing only a single tuple, the result of applyingQuadConstraintCollector
.UniConstraintStream
which only has a single tuple, the result of applyingQuadConstraintCollector
.- Specified by:
groupBy
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
ResultContainer_
- the mutable accumulation type (often hidden as an implementation detail)Result_
- the type of a fact in the destinationUniConstraintStream
's tuple- Parameters:
collector
- never null, the collector to perform the grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
public <ResultContainerA_,ResultA_,ResultContainerB_,ResultB_> BiConstraintStream<ResultA_,ResultB_> groupBy(QuadConstraintCollector<A,B,C,D,ResultContainerA_,ResultA_> collectorA, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB)
Description copied from interface:QuadConstraintStream
Convert theQuadConstraintStream
to aBiConstraintStream
, containing only a single tuple, the result of applying twoQuadConstraintCollector
s.- Specified by:
groupBy
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
ResultContainerA_
- the mutable accumulation type (often hidden as an implementation detail)ResultA_
- the type of the first fact in the destinationBiConstraintStream
's tupleResultContainerB_
- the mutable accumulation type (often hidden as an implementation detail)ResultB_
- the type of the second fact in the destinationBiConstraintStream
's tuple- Parameters:
collectorA
- never null, the collector to perform the first grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorB
- never null, the collector to perform the second grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
public <ResultContainerA_,ResultA_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_> TriConstraintStream<ResultA_,ResultB_,ResultC_> groupBy(QuadConstraintCollector<A,B,C,D,ResultContainerA_,ResultA_> collectorA, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC)
Description copied from interface:QuadConstraintStream
Convert theQuadConstraintStream
to aTriConstraintStream
, containing only a single tuple, the result of applying threeQuadConstraintCollector
s.- Specified by:
groupBy
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
ResultContainerA_
- the mutable accumulation type (often hidden as an implementation detail)ResultA_
- the type of the first fact in the destinationTriConstraintStream
's tupleResultContainerB_
- the mutable accumulation type (often hidden as an implementation detail)ResultB_
- the type of the second fact in the destinationTriConstraintStream
's tupleResultContainerC_
- the mutable accumulation type (often hidden as an implementation detail)ResultC_
- the type of the third fact in the destinationTriConstraintStream
's tuple- Parameters:
collectorA
- never null, the collector to perform the first grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorB
- never null, the collector to perform the second grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorC
- never null, the collector to perform the third grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
public <ResultContainerA_,ResultA_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_> QuadConstraintStream<ResultA_,ResultB_,ResultC_,ResultD_> groupBy(QuadConstraintCollector<A,B,C,D,ResultContainerA_,ResultA_> collectorA, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
Description copied from interface:QuadConstraintStream
Convert theQuadConstraintStream
to aQuadConstraintStream
, containing only a single tuple, the result of applying fourQuadConstraintCollector
s.- Specified by:
groupBy
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
ResultContainerA_
- the mutable accumulation type (often hidden as an implementation detail)ResultA_
- the type of the first fact in the destinationQuadConstraintStream
's tupleResultContainerB_
- the mutable accumulation type (often hidden as an implementation detail)ResultB_
- the type of the second fact in the destinationQuadConstraintStream
's tupleResultContainerC_
- the mutable accumulation type (often hidden as an implementation detail)ResultC_
- the type of the third fact in the destinationQuadConstraintStream
's tupleResultContainerD_
- the mutable accumulation type (often hidden as an implementation detail)ResultD_
- the type of the fourth fact in the destinationQuadConstraintStream
's tuple- Parameters:
collectorA
- never null, the collector to perform the first grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorB
- never null, the collector to perform the second grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorC
- never null, the collector to perform the third grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorD
- never null, the collector to perform the fourth grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
public <GroupKey_> UniConstraintStream<GroupKey_> groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping)
Description copied from interface:QuadConstraintStream
Convert theQuadConstraintStream
to aUniConstraintStream
, 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 streamObjects.equals(Object, Object)
any other.- Specified by:
groupBy
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
GroupKey_
- the type of a fact in the destinationUniConstraintStream
's tuple- Parameters:
groupKeyMapping
- never null, mapping function to convert each element in the stream to a different element- Returns:
- never null
-
groupBy
public <GroupKey_,ResultContainer_,Result_> BiConstraintStream<GroupKey_,Result_> groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping, QuadConstraintCollector<A,B,C,D,ResultContainer_,Result_> collector)
Description copied from interface:QuadConstraintStream
Convert theQuadConstraintStream
to aBiConstraintStream
, consisting of unique tuples.The first fact is the return value of the 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.- Specified by:
groupBy
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
GroupKey_
- the type of the first fact in the destinationBiConstraintStream
's tupleResultContainer_
- the mutable accumulation type (often hidden as an implementation detail)Result_
- the type of the second fact in the destinationBiConstraintStream
's tuple- Parameters:
groupKeyMapping
- never null, function to convert the fact in the original tuple to a different factcollector
- never null, the collector to perform the grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
public <GroupKey_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_> TriConstraintStream<GroupKey_,ResultB_,ResultC_> groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC)
Description copied from interface:QuadConstraintStream
Convert theQuadConstraintStream
to aTriConstraintStream
, consisting of unique tuples with three facts.The first fact is the return value of the group key mapping function, applied on the incoming tuple. The remaining facts are the return value of the respective
QuadConstraintCollector
applied on all incoming tuples with the same first fact.- Specified by:
groupBy
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
GroupKey_
- the type of the first fact in the destinationTriConstraintStream
's tupleResultContainerB_
- the mutable accumulation type (often hidden as an implementation detail)ResultB_
- the type of the second fact in the destinationTriConstraintStream
's tupleResultContainerC_
- the mutable accumulation type (often hidden as an implementation detail)ResultC_
- the type of the third fact in the destinationTriConstraintStream
's tuple- Parameters:
groupKeyMapping
- never null, function to convert the fact in the original tuple to a different factcollectorB
- never null, the collector to perform the first grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorC
- never null, the collector to perform the second grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
public <GroupKey_,ResultContainerB_,ResultB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_> QuadConstraintStream<GroupKey_,ResultB_,ResultC_,ResultD_> groupBy(QuadFunction<A,B,C,D,GroupKey_> groupKeyMapping, QuadConstraintCollector<A,B,C,D,ResultContainerB_,ResultB_> collectorB, QuadConstraintCollector<A,B,C,D,ResultContainerC_,ResultC_> collectorC, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
Description copied from interface:QuadConstraintStream
Convert theQuadConstraintStream
to aQuadConstraintStream
, consisting of unique tuples with four facts.The first fact is the return value of the group key mapping function, applied on the incoming tuple. The remaining facts are the return value of the respective
QuadConstraintCollector
applied on all incoming tuples with the same first fact.- Specified by:
groupBy
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
GroupKey_
- the type of the first fact in the destinationQuadConstraintStream
's tupleResultContainerB_
- the mutable accumulation type (often hidden as an implementation detail)ResultB_
- the type of the second fact in the destinationQuadConstraintStream
's tupleResultContainerC_
- the mutable accumulation type (often hidden as an implementation detail)ResultC_
- the type of the third fact in the destinationQuadConstraintStream
's tupleResultContainerD_
- the mutable accumulation type (often hidden as an implementation detail)ResultD_
- the type of the fourth fact in the destinationQuadConstraintStream
's tuple- Parameters:
groupKeyMapping
- never null, function to convert the fact in the original tuple to a different factcollectorB
- never null, the collector to perform the first grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorC
- never null, the collector to perform the second grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorD
- never null, the collector to perform the third grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
public <GroupKeyA_,GroupKeyB_> BiConstraintStream<GroupKeyA_,GroupKeyB_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping)
Description copied from interface:QuadConstraintStream
Convert theQuadConstraintStream
to aBiConstraintStream
, 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.
- Specified by:
groupBy
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
GroupKeyA_
- the type of the first fact in the destinationBiConstraintStream
's tupleGroupKeyB_
- the type of the second fact in the destinationBiConstraintStream
's tuple- Parameters:
groupKeyAMapping
- 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- Returns:
- never null
-
groupBy
public <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)
Description copied from interface:QuadConstraintStream
Combines the semantics ofQuadConstraintStream.groupBy(QuadFunction, QuadFunction)
andQuadConstraintStream.groupBy(QuadConstraintCollector)
. That is, the first and second facts in the tuple follow theQuadConstraintStream.groupBy(QuadFunction, QuadFunction)
semantics, and the third fact is the result of applyingQuadConstraintCollector.finisher()
on all the tuples of the originalUniConstraintStream
that belong to the group.- Specified by:
groupBy
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
GroupKeyA_
- the type of the first fact in the destinationTriConstraintStream
's tupleGroupKeyB_
- the type of the second fact in the destinationTriConstraintStream
's tupleResultContainer_
- the mutable accumulation type (often hidden as an implementation detail)Result_
- the type of the third fact in the destinationTriConstraintStream
's tuple- Parameters:
groupKeyAMapping
- 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 SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
public <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)
Description copied from interface:QuadConstraintStream
Combines the semantics ofQuadConstraintStream.groupBy(QuadFunction, QuadFunction)
andQuadConstraintStream.groupBy(QuadConstraintCollector)
. That is, the first and second facts in the tuple follow theQuadConstraintStream.groupBy(QuadFunction, QuadFunction)
semantics. The third fact is the result of applying the firstQuadConstraintCollector.finisher()
on all the tuples of the originalQuadConstraintStream
that belong to the group. The fourth fact is the result of applying the secondQuadConstraintCollector.finisher()
on all the tuples of the originalQuadConstraintStream
that belong to the group- Specified by:
groupBy
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
GroupKeyA_
- the type of the first fact in the destinationQuadConstraintStream
's tupleGroupKeyB_
- the type of the second fact in the destinationQuadConstraintStream
's tupleResultContainerC_
- the mutable accumulation type (often hidden as an implementation detail)ResultC_
- the type of the third fact in the destinationQuadConstraintStream
's tupleResultContainerD_
- the mutable accumulation type (often hidden as an implementation detail)ResultD_
- the type of the fourth fact in the destinationQuadConstraintStream
's tuple- Parameters:
groupKeyAMapping
- 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 with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.collectorD
- never null, the collector to perform the second grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
public <GroupKeyA_,GroupKeyB_,GroupKeyC_> TriConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadFunction<A,B,C,D,GroupKeyC_> groupKeyCMapping)
Description copied from interface:QuadConstraintStream
Convert theQuadConstraintStream
to aTriConstraintStream
, consisting of unique tuples with three facts.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. The third fact is the return value of the third group key mapping function, applied on all incoming tuples with the same first fact.
- Specified by:
groupBy
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
GroupKeyA_
- the type of the first fact in the destinationTriConstraintStream
's tupleGroupKeyB_
- the type of the second fact in the destinationTriConstraintStream
's tupleGroupKeyC_
- the type of the third fact in the destinationTriConstraintStream
's tuple- Parameters:
groupKeyAMapping
- never null, function to convert the original tuple into a first factgroupKeyBMapping
- never null, function to convert the original tuple into a second factgroupKeyCMapping
- never null, function to convert the original tuple into a third fact- Returns:
- never null
-
groupBy
public <GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultContainerD_,ResultD_> QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,ResultD_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadFunction<A,B,C,D,GroupKeyC_> groupKeyCMapping, QuadConstraintCollector<A,B,C,D,ResultContainerD_,ResultD_> collectorD)
Description copied from interface:QuadConstraintStream
Combines the semantics ofQuadConstraintStream.groupBy(QuadFunction, QuadFunction)
andQuadConstraintStream.groupBy(QuadConstraintCollector)
. That is, the first three facts in the tuple follow theQuadConstraintStream.groupBy(QuadFunction, QuadFunction)
semantics. The final fact is the result of applying the firstQuadConstraintCollector.finisher()
on all the tuples of the originalQuadConstraintStream
that belong to the group.- Specified by:
groupBy
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
GroupKeyA_
- the type of the first fact in the destinationQuadConstraintStream
's tupleGroupKeyB_
- the type of the second fact in the destinationQuadConstraintStream
's tupleGroupKeyC_
- the type of the third fact in the destinationQuadConstraintStream
's tupleResultContainerD_
- the mutable accumulation type (often hidden as an implementation detail)ResultD_
- the type of the fourth fact in the destinationQuadConstraintStream
's tuple- Parameters:
groupKeyAMapping
- never null, function to convert the original tuple into a first factgroupKeyBMapping
- never null, function to convert the original tuple into a second factgroupKeyCMapping
- never null, function to convert the original tuple into a third factcollectorD
- never null, the collector to perform the grouping operation with SeeConstraintCollectors
for common operations, such ascount()
,sum()
and others.- Returns:
- never null
-
groupBy
public <GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_> QuadConstraintStream<GroupKeyA_,GroupKeyB_,GroupKeyC_,GroupKeyD_> groupBy(QuadFunction<A,B,C,D,GroupKeyA_> groupKeyAMapping, QuadFunction<A,B,C,D,GroupKeyB_> groupKeyBMapping, QuadFunction<A,B,C,D,GroupKeyC_> groupKeyCMapping, QuadFunction<A,B,C,D,GroupKeyD_> groupKeyDMapping)
Description copied from interface:QuadConstraintStream
Convert theTriConstraintStream
to aQuadConstraintStream
, consisting of unique tuples with four facts.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. The third fact is the return value of the third group key mapping function, applied on all incoming tuples with the same first fact. The fourth fact is the return value of the fourth group key mapping function, applied on all incoming tuples with the same first fact.
- Specified by:
groupBy
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
GroupKeyA_
- the type of the first fact in the destinationQuadConstraintStream
's tupleGroupKeyB_
- the type of the second fact in the destinationQuadConstraintStream
's tupleGroupKeyC_
- the type of the third fact in the destinationQuadConstraintStream
's tupleGroupKeyD_
- the type of the fourth fact in the destinationQuadConstraintStream
's tuple- Parameters:
groupKeyAMapping
- never null, function to convert the original tuple into a first factgroupKeyBMapping
- never null, function to convert the original tuple into a second factgroupKeyCMapping
- never null, function to convert the original tuple into a third factgroupKeyDMapping
- never null, function to convert the original tuple into a fourth fact- Returns:
- never null
-
map
public <ResultA_> UniConstraintStream<ResultA_> map(QuadFunction<A,B,C,D,ResultA_> mapping)
Description copied from interface:QuadConstraintStream
As defined byUniConstraintStream.map(Function)
.- Specified by:
map
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
ResultA_
- the type of the only fact in the resultingUniConstraintStream
's tuple- Parameters:
mapping
- never null, function to convert the original tuple into the new tuple- Returns:
- never null
-
flattenLast
public <ResultD_> QuadConstraintStream<A,B,C,ResultD_> flattenLast(Function<D,Iterable<ResultD_>> mapping)
Description copied from interface:QuadConstraintStream
As defined byBiConstraintStream.flattenLast(Function)
.- Specified by:
flattenLast
in interfaceQuadConstraintStream<Solution_,A,B,C>
- Type Parameters:
ResultD_
- the type of the last fact in the resulting tuples- Parameters:
mapping
- never null, function to convert the last fact in the original tuple intoIterable
- Returns:
- never null
-
impactScore
protected Constraint impactScore(String constraintPackage, String constraintName, Score<?> constraintWeight, ScoreImpactType impactType)
- Specified by:
impactScore
in classAbstractConstraintStream<Solution_>
-
impactScore
public Constraint impactScore(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntQuadFunction<A,B,C,D> matchWeigher, ScoreImpactType impactType)
- Specified by:
impactScore
in interfaceInnerQuadConstraintStream<Solution_,A,B,C>
-
impactScoreLong
public Constraint impactScoreLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongQuadFunction<A,B,C,D> matchWeigher, ScoreImpactType impactType)
- Specified by:
impactScoreLong
in interfaceInnerQuadConstraintStream<Solution_,A,B,C>
-
impactScoreBigDecimal
public Constraint impactScoreBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, QuadFunction<A,B,C,D,BigDecimal> matchWeigher, ScoreImpactType impactType)
- Specified by:
impactScoreBigDecimal
in interfaceInnerQuadConstraintStream<Solution_,A,B,C>
-
impactScoreConfigurable
protected Constraint impactScoreConfigurable(String constraintPackage, String constraintName, ScoreImpactType impactType)
- Specified by:
impactScoreConfigurable
in classAbstractConstraintStream<Solution_>
-
impactScoreConfigurable
public Constraint impactScoreConfigurable(String constraintPackage, String constraintName, ToIntQuadFunction<A,B,C,D> matchWeigher, ScoreImpactType impactType)
- Specified by:
impactScoreConfigurable
in interfaceInnerQuadConstraintStream<Solution_,A,B,C>
-
impactScoreConfigurableLong
public Constraint impactScoreConfigurableLong(String constraintPackage, String constraintName, ToLongQuadFunction<A,B,C,D> matchWeigher, ScoreImpactType impactType)
- Specified by:
impactScoreConfigurableLong
in interfaceInnerQuadConstraintStream<Solution_,A,B,C>
-
impactScoreConfigurableBigDecimal
public Constraint impactScoreConfigurableBigDecimal(String constraintPackage, String constraintName, QuadFunction<A,B,C,D,BigDecimal> matchWeigher, ScoreImpactType impactType)
- Specified by:
impactScoreConfigurableBigDecimal
in interfaceInnerQuadConstraintStream<Solution_,A,B,C>
-
getLeftHandSide
public abstract QuadLeftHandSide<A,B,C,D> getLeftHandSide()
-
-