Class BavetAbstractQuadConstraintStream<Solution_,A,B,C,D>
- All Implemented Interfaces:
ConstraintStream,QuadConstraintStream<A,,B, C, D> InnerQuadConstraintStream<A,B, C, D>
- Direct Known Subclasses:
BavetAftBridgeQuadConstraintStream,BavetBiConcatQuadConstraintStream,BavetForeBridgeQuadConstraintStream,BavetJoinQuadConstraintStream,BavetQuadConcatQuadConstraintStream,BavetTriConcatQuadConstraintStream,BavetUniConcatQuadConstraintStream
-
Field Summary
Fields inherited from class ai.timefold.solver.core.impl.score.stream.bavet.common.BavetAbstractConstraintStream
childStreamList, constraintFactory, parent -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBavetAbstractQuadConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, BavetAbstractConstraintStream<Solution_> parent) protectedBavetAbstractQuadConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, RetrievalSemantics retrievalSemantics) -
Method Summary
Modifier and TypeMethodDescriptionconcat(BiConstraintStream<A, B> otherStream, BiFunction<A, B, C> paddingFunctionC, BiFunction<A, B, D> paddingFunctionD) Returns a newQuadConstraintStreamcontaining all the tuples of both thisQuadConstraintStreamand the providedBiConstraintStream.Returns a newQuadConstraintStreamcontaining all the tuples of both thisQuadConstraintStreamand the providedQuadConstraintStream.concat(TriConstraintStream<A, B, C> otherStream, TriFunction<A, B, C, D> paddingFunction) Returns a newQuadConstraintStreamcontaining all the tuples of both thisQuadConstraintStreamand the providedTriConstraintStream.concat(UniConstraintStream<A> otherStream, Function<A, B> paddingFunctionB, Function<A, C> paddingFunctionC, Function<A, D> paddingFunctionD) Returns a newQuadConstraintStreamcontaining all the tuples of both thisQuadConstraintStreamand the providedUniConstraintStream.Exhaustively test each tuple of facts against theQuadPredicateand 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).protected final QuadFunction<A,B, C, D, Collection<?>> protected final PentaFunction<A,B, C, D, Score<?>, DefaultConstraintJustification> <GroupKey_>
UniConstraintStream<GroupKey_>Convert theQuadConstraintStreamto 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 theQuadConstraintStreamto 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 theQuadConstraintStreamto 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 theQuadConstraintStreamto 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 theQuadConstraintStreamto 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 theQuadConstraintStreamto 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 theTriConstraintStreamto 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_>Convert theQuadConstraintStreamto 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 theQuadConstraintStreamto aBiConstraintStream, containing only a single tuple, the result of applying twoQuadConstraintCollectors.<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 theQuadConstraintStreamto aTriConstraintStream, containing only a single tuple, the result of applying threeQuadConstraintCollectors.<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 theQuadConstraintStreamto aQuadConstraintStream, containing only a single tuple, the result of applying fourQuadConstraintCollectors.final <E> QuadConstraintStream<A,B, C, D> ifExists(UniConstraintStream<E> otherStream, PentaJoiner<A, B, C, D, E>... joiners) final <E> QuadConstraintStream<A,B, C, D> ifNotExists(UniConstraintStream<E> otherStream, PentaJoiner<A, B, C, D, E>... joiners) innerImpact(Score_ constraintWeight, QuadFunction<A, B, C, D, BigDecimal> matchWeigher, ScoreImpactType scoreImpactType) innerImpact(Score_ constraintWeight, ToIntQuadFunction<A, B, C, D> matchWeigher, ScoreImpactType scoreImpactType) innerImpact(Score_ constraintWeight, ToLongQuadFunction<A, B, C, D> matchWeigher, ScoreImpactType scoreImpactType) <ResultA_> UniConstraintStream<ResultA_>As defined byUniConstraintStream.map(Function).<ResultA_,ResultB_>
BiConstraintStream<ResultA_,ResultB_> As defined byQuadConstraintStream.map(QuadFunction), only resulting inBiConstraintStream.<ResultA_,ResultB_, ResultC_>
TriConstraintStream<ResultA_,ResultB_, ResultC_> map(QuadFunction<A, B, C, D, ResultA_> mappingA, QuadFunction<A, B, C, D, ResultB_> mappingB, QuadFunction<A, B, C, D, ResultC_> mappingC) As defined byQuadConstraintStream.map(QuadFunction), only resulting inTriConstraintStream.<ResultA_,ResultB_, ResultC_, ResultD_>
QuadConstraintStream<ResultA_,ResultB_, ResultC_, ResultD_> map(QuadFunction<A, B, C, D, ResultA_> mappingA, QuadFunction<A, B, C, D, ResultB_> mappingB, QuadFunction<A, B, C, D, ResultC_> mappingC, QuadFunction<A, B, C, D, ResultD_> mappingD) As defined byQuadConstraintStream.map(QuadFunction), only resulting inQuadConstraintStream.Methods inherited from class ai.timefold.solver.core.impl.score.stream.bavet.common.BavetAbstractConstraintStream
assertEmptyChildStreamList, buildConstraint, buildNode, collectActiveConstraintStreams, getChildStreamList, getConstraintFactory, getParent, getTupleSource, guaranteesDistinct, shareAndAddChildMethods inherited from class ai.timefold.solver.core.impl.score.stream.common.AbstractConstraintStream
getRetrievalSemanticsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.timefold.solver.core.api.score.stream.ConstraintStream
getConstraintFactoryMethods inherited from interface ai.timefold.solver.core.impl.score.stream.common.quad.InnerQuadConstraintStream
distinct, getRetrievalSemantics, guaranteesDistinct, ifExists, ifExistsIncludingUnassigned, ifNotExists, ifNotExistsIncludingUnassigned, impact, impact, impact, impactBigDecimal, impactConfigurable, impactConfigurableBigDecimal, impactConfigurableLong, impactLong, penalize, penalize, penalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurable, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, reward, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurable, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLongMethods inherited from interface ai.timefold.solver.core.api.score.stream.quad.QuadConstraintStream
complement, complement, concat, concat, concat, ifExists, ifExists, ifExists, ifExists, ifExists, ifExists, ifExists, ifExists, ifExistsIncludingNullVars, ifExistsIncludingNullVars, ifExistsIncludingNullVars, ifExistsIncludingNullVars, ifExistsIncludingNullVars, ifExistsIncludingUnassigned, ifExistsIncludingUnassigned, ifExistsIncludingUnassigned, ifExistsIncludingUnassigned, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExistsIncludingNullVars, ifNotExistsIncludingNullVars, ifNotExistsIncludingNullVars, ifNotExistsIncludingNullVars, ifNotExistsIncludingNullVars, ifNotExistsIncludingUnassigned, ifNotExistsIncludingUnassigned, ifNotExistsIncludingUnassigned, ifNotExistsIncludingUnassigned, impact, impact, impact, impactBigDecimal, impactBigDecimal, impactConfigurable, impactConfigurable, impactConfigurable, impactConfigurableBigDecimal, impactConfigurableBigDecimal, impactConfigurableLong, impactConfigurableLong, impactLong, impactLong, penalize, penalize, penalize, penalizeBigDecimal, penalizeBigDecimal, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurable, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeConfigurableLong, penalizeLong, penalizeLong, penalizeLong, reward, reward, reward, rewardBigDecimal, rewardBigDecimal, rewardConfigurable, rewardConfigurable, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardConfigurableLong, rewardLong, rewardLong
-
Constructor Details
-
BavetAbstractQuadConstraintStream
protected BavetAbstractQuadConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, BavetAbstractConstraintStream<Solution_> parent) -
BavetAbstractQuadConstraintStream
protected BavetAbstractQuadConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, RetrievalSemantics retrievalSemantics)
-
-
Method Details
-
filter
public BavetAbstractQuadConstraintStream<Solution_,A, filterB, C, D> (QuadPredicate<A, B, C, D> predicate) Description copied from interface:QuadConstraintStreamExhaustively test each tuple of facts against theQuadPredicateand match ifQuadPredicate.test(Object, Object, Object, Object)returns true.Important: This is slower and less scalable than
TriConstraintStream.join(UniConstraintStream, QuadJoiner)with a properQuadJoinerpredicate (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, ifExistsC, D> (UniConstraintStream<E> otherStream, PentaJoiner<A, B, C, D, E>... joiners) Description copied from interface:QuadConstraintStreamAs defined byQuadConstraintStream.ifExists(UniConstraintStream, 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
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4PentaJoinerparameters.- Specified by:
ifExistsin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
E- the type of the fifth matched fact- Parameters:
otherStream- 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
PentaJoiners are true
-
ifNotExists
@SafeVarargs public final <E> QuadConstraintStream<A,B, ifNotExistsC, D> (UniConstraintStream<E> otherStream, PentaJoiner<A, B, C, D, E>... joiners) Description copied from interface:QuadConstraintStreamAs defined byQuadConstraintStream.ifNotExists(UniConstraintStream, 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
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4PentaJoinerparameters.- Specified by:
ifNotExistsin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
E- the type of the fifth matched fact- Parameters:
otherStream- 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
PentaJoiners are true
-
groupBy
public <ResultContainer_,Result_> UniConstraintStream<Result_> groupBy(QuadConstraintCollector<A, B, C, D, ResultContainer_, Result_> collector) Description copied from interface:QuadConstraintStreamConvert theQuadConstraintStreamto aUniConstraintStream, containing only a single tuple, the result of applyingQuadConstraintCollector.UniConstraintStreamwhich only has a single tuple, the result of applyingQuadConstraintCollector.- Specified by:
groupByin 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 SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <ResultContainerA_,ResultA_, BiConstraintStream<ResultA_,ResultContainerB_, ResultB_> ResultB_> groupBy(QuadConstraintCollector<A, B, C, D, ResultContainerA_, ResultA_> collectorA, QuadConstraintCollector<A, B, C, D, ResultContainerB_, ResultB_> collectorB) Description copied from interface:QuadConstraintStreamConvert theQuadConstraintStreamto aBiConstraintStream, containing only a single tuple, the result of applying twoQuadConstraintCollectors.- Specified by:
groupByin 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 SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorB- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <ResultContainerA_,ResultA_, TriConstraintStream<ResultA_,ResultContainerB_, ResultB_, ResultContainerC_, ResultC_> ResultB_, groupByResultC_> (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:QuadConstraintStreamConvert theQuadConstraintStreamto aTriConstraintStream, containing only a single tuple, the result of applying threeQuadConstraintCollectors.- Specified by:
groupByin 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 SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorB- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorC- never null, the collector to perform the third grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <ResultContainerA_,ResultA_, QuadConstraintStream<ResultA_,ResultContainerB_, ResultB_, ResultContainerC_, ResultC_, ResultContainerD_, ResultD_> ResultB_, groupByResultC_, ResultD_> (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:QuadConstraintStreamConvert theQuadConstraintStreamto aQuadConstraintStream, containing only a single tuple, the result of applying fourQuadConstraintCollectors.- Specified by:
groupByin 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 SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorB- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorC- never null, the collector to perform the third grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorD- never null, the collector to perform the fourth grouping operation with SeeConstraintCollectorsfor 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:QuadConstraintStreamConvert theQuadConstraintStreamto 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:
groupByin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
GroupKey_- the type of a fact in the destinationUniConstraintStream's tuple; must honorthe general contract of hashCode.- Parameters:
groupKeyMapping- never null, mapping function to convert each element in the stream to a different element- Returns:
- never null
-
groupBy
public <GroupKey_,ResultContainerB_, TriConstraintStream<GroupKey_,ResultB_, ResultContainerC_, ResultC_> ResultB_, groupByResultC_> (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:QuadConstraintStreamConvert theQuadConstraintStreamto 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
QuadConstraintCollectorapplied on all incoming tuples with the same first fact.- Specified by:
groupByin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
GroupKey_- the type of the first fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainerB_- 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 SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorC- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <GroupKey_,ResultContainerB_, QuadConstraintStream<GroupKey_,ResultB_, ResultContainerC_, ResultC_, ResultContainerD_, ResultD_> ResultB_, groupByResultC_, ResultD_> (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:QuadConstraintStreamConvert theQuadConstraintStreamto 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
QuadConstraintCollectorapplied on all incoming tuples with the same first fact.- Specified by:
groupByin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
GroupKey_- the type of the first fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainerB_- 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 SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorC- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorD- never null, the collector to perform the third grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <GroupKey_,ResultContainer_, BiConstraintStream<GroupKey_,Result_> Result_> groupBy(QuadFunction<A, B, C, D, GroupKey_> groupKeyMapping, QuadConstraintCollector<A, B, C, D, ResultContainer_, Result_> collector) Description copied from interface:QuadConstraintStreamConvert theQuadConstraintStreamto 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
QuadConstraintCollectorapplied on all incoming tuples with the same first fact.- Specified by:
groupByin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
GroupKey_- the type of the first fact in the destinationBiConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainer_- 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 SeeConstraintCollectorsfor 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:QuadConstraintStreamConvert theQuadConstraintStreamto 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:
groupByin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
GroupKeyA_- the type of the first fact in the destinationBiConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationBiConstraintStream's tuple; must honorthe general contract of hashCode.- 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_, TriConstraintStream<GroupKeyA_,ResultContainer_, Result_> GroupKeyB_, groupByResult_> (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:QuadConstraintStreamCombines 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 originalUniConstraintStreamthat belong to the group.- Specified by:
groupByin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
GroupKeyA_- the type of the first fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainer_- 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 SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <GroupKeyA_,GroupKeyB_, QuadConstraintStream<GroupKeyA_,ResultContainerC_, ResultC_, ResultContainerD_, ResultD_> GroupKeyB_, groupByResultC_, ResultD_> (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:QuadConstraintStreamCombines 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 originalQuadConstraintStreamthat belong to the group. The fourth fact is the result of applying the secondQuadConstraintCollector.finisher()on all the tuples of the originalQuadConstraintStreamthat belong to the group- Specified by:
groupByin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
GroupKeyA_- the type of the first fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainerC_- 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 SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorD- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <GroupKeyA_,GroupKeyB_, TriConstraintStream<GroupKeyA_,GroupKeyC_> GroupKeyB_, groupByGroupKeyC_> (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:QuadConstraintStreamConvert theQuadConstraintStreamto 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:
groupByin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
GroupKeyA_- the type of the first fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyC_- the type of the third fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.- 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_, QuadConstraintStream<GroupKeyA_,GroupKeyC_, ResultContainerD_, ResultD_> GroupKeyB_, groupByGroupKeyC_, ResultD_> (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:QuadConstraintStreamCombines 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 originalQuadConstraintStreamthat belong to the group.- Specified by:
groupByin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
GroupKeyA_- the type of the first fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyC_- the type of the third fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainerD_- 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 SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <GroupKeyA_,GroupKeyB_, QuadConstraintStream<GroupKeyA_,GroupKeyC_, GroupKeyD_> GroupKeyB_, groupByGroupKeyC_, GroupKeyD_> (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:QuadConstraintStreamConvert theTriConstraintStreamto 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:
groupByin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
GroupKeyA_- the type of the first fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyC_- the type of the third fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyD_- the type of the fourth fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.- 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
-
concat
public QuadConstraintStream<A,B, concatC, D> (UniConstraintStream<A> otherStream, Function<A, B> paddingFunctionB, Function<A, C> paddingFunctionC, Function<A, D> paddingFunctionD) Description copied from interface:QuadConstraintStreamReturns a newQuadConstraintStreamcontaining all the tuples of both thisQuadConstraintStreamand the providedUniConstraintStream. TheUniConstraintStreamtuples will be padded from the right by the results of the padding functions.For instance, if this stream consists of
[(A1, A2, A3, A4), (B1, B2, B3, B4), (C1, C2, C3, C4)]and the other stream consists of[C, D, E],this.concat(other, a -> null, a -> null, a -> null)will consist of[(A1, A2, A3, A4), (B1, B2, B3, B4), (C1, C2, C3, C4), (C, null, null, null), (D, null, null, null), (E, null, null, null)].This operation can be thought of as an or between streams.
- Specified by:
concatin interfaceQuadConstraintStream<Solution_,A, B, C> - Parameters:
otherStream- never nullpaddingFunctionB- never null, function to find the padding for the second factpaddingFunctionC- never null, function to find the padding for the third factpaddingFunctionD- never null, function to find the padding for the fourth fact- Returns:
- never null
-
concat
public QuadConstraintStream<A,B, concatC, D> (BiConstraintStream<A, B> otherStream, BiFunction<A, B, C> paddingFunctionC, BiFunction<A, B, D> paddingFunctionD) Description copied from interface:QuadConstraintStreamReturns a newQuadConstraintStreamcontaining all the tuples of both thisQuadConstraintStreamand the providedBiConstraintStream. TheBiConstraintStreamtuples will be padded from the right by the results of the padding functions.For instance, if this stream consists of
[(A1, A2, A3, A4), (B1, B2, B3, B4), (C1, C2, C3, C4)]and the other stream consists of[(C1, C2), (D1, D2), (E1, E2)],this.concat(other, (a, b) -> null, (a, b) -> null)will consist of[(A1, A2, A3, A4), (B1, B2, B3, B4), (C1, C2, C3, C4), (C1, C2, null, null), (D1, D2, null, null), (E1, E2, null, null)].This operation can be thought of as an or between streams.
-
concat
public QuadConstraintStream<A,B, concatC, D> (TriConstraintStream<A, B, C> otherStream, TriFunction<A, B, C, D> paddingFunction) Description copied from interface:QuadConstraintStreamReturns a newQuadConstraintStreamcontaining all the tuples of both thisQuadConstraintStreamand the providedTriConstraintStream. TheTriConstraintStreamtuples will be padded from the right by the result of the padding function.For instance, if this stream consists of
[(A1, A2, A3, A4), (B1, B2, B3, B4), (C1, C2, C3, C4)]and the other stream consists of[(C1, C2, C3), (D1, D2, D3), (E1, E2, E3)],this.concat(other, (a, b, c) -> null)will consist of[(A1, A2, A3, A4), (B1, B2, B3, B4), (C1, C2, C3, C4), (C1, C2, C3, null), (D1, D2, D3, null), (E1, E2, E3, null)].This operation can be thought of as an or between streams.
-
concat
Description copied from interface:QuadConstraintStreamReturns a newQuadConstraintStreamcontaining all the tuples of both thisQuadConstraintStreamand the providedQuadConstraintStream. Tuples in both thisQuadConstraintStreamand the providedQuadConstraintStreamwill appear at least twice.For instance, if this stream consists of
[(A, 1, -1, a), (B, 2, -2, b), (C, 3, -3, c)]and the other stream consists of[(C, 3, -3, c), (D, 4, -4, d), (E, 5, -5, e)],this.concat(other)will consist of[(A, 1, -1, a), (B, 2, -2, b), (C, 3, -3, c), (C, 3, -3, c), (D, 4, -4, d), (E, 5, -5,e)].This operation can be thought of as an or between streams.
-
map
Description copied from interface:QuadConstraintStreamAs defined byUniConstraintStream.map(Function).- Specified by:
mapin 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
-
map
public <ResultA_,ResultB_> BiConstraintStream<ResultA_,ResultB_> map(QuadFunction<A, B, C, D, ResultA_> mappingA, QuadFunction<A, B, C, D, ResultB_> mappingB) Description copied from interface:QuadConstraintStreamAs defined byQuadConstraintStream.map(QuadFunction), only resulting inBiConstraintStream.- Specified by:
mapin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
ResultA_- the type of the first fact in the resultingBiConstraintStream's tupleResultB_- the type of the first fact in the resultingBiConstraintStream's tuple- Parameters:
mappingA- never null, function to convert the original tuple into the first fact of a new tuplemappingB- never null, function to convert the original tuple into the second fact of a new tuple- Returns:
- never null
-
map
public <ResultA_,ResultB_, TriConstraintStream<ResultA_,ResultC_> ResultB_, mapResultC_> (QuadFunction<A, B, C, D, ResultA_> mappingA, QuadFunction<A, B, C, D, ResultB_> mappingB, QuadFunction<A, B, C, D, ResultC_> mappingC) Description copied from interface:QuadConstraintStreamAs defined byQuadConstraintStream.map(QuadFunction), only resulting inTriConstraintStream.- Specified by:
mapin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
ResultA_- the type of the first fact in the resultingTriConstraintStream's tupleResultB_- the type of the first fact in the resultingTriConstraintStream's tupleResultC_- the type of the third fact in the resultingTriConstraintStream's tuple- Parameters:
mappingA- never null, function to convert the original tuple into the first fact of a new tuplemappingB- never null, function to convert the original tuple into the second fact of a new tuplemappingC- never null, function to convert the original tuple into the third fact of a new tuple- Returns:
- never null
-
map
public <ResultA_,ResultB_, QuadConstraintStream<ResultA_,ResultC_, ResultD_> ResultB_, mapResultC_, ResultD_> (QuadFunction<A, B, C, D, ResultA_> mappingA, QuadFunction<A, B, C, D, ResultB_> mappingB, QuadFunction<A, B, C, D, ResultC_> mappingC, QuadFunction<A, B, C, D, ResultD_> mappingD) Description copied from interface:QuadConstraintStreamAs defined byQuadConstraintStream.map(QuadFunction), only resulting inQuadConstraintStream.- Specified by:
mapin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
ResultA_- the type of the first fact in the resultingQuadConstraintStream's tupleResultB_- the type of the first fact in the resultingQuadConstraintStream's tupleResultC_- the type of the third fact in the resultingQuadConstraintStream's tupleResultD_- the type of the third fact in the resultingQuadConstraintStream's tuple- Parameters:
mappingA- never null, function to convert the original tuple into the first fact of a new tuplemappingB- never null, function to convert the original tuple into the second fact of a new tuplemappingC- never null, function to convert the original tuple into the third fact of a new tuplemappingD- never null, function to convert the original tuple into the fourth fact of a new tuple- Returns:
- never null
-
flattenLast
public <ResultD_> QuadConstraintStream<A,B, flattenLastC, ResultD_> (Function<D, Iterable<ResultD_>> mapping) Description copied from interface:QuadConstraintStreamAs defined byBiConstraintStream.flattenLast(Function).- Specified by:
flattenLastin interfaceQuadConstraintStream<Solution_,A, B, C> - Type Parameters:
ResultD_- the type of the last fact in the resulting tuples. It is recommended that this type be deeply immutable. Not following this recommendation may lead to hard-to-debug hashing issues down the stream, especially if this value is ever used as a group key.- Parameters:
mapping- never null, function to convert the last fact in the original tuple intoIterable. For performance, returning an implementation ofCollectionis preferred.- Returns:
- never null
-
innerImpact
public <Score_ extends Score<Score_>> QuadConstraintBuilder<A,B, innerImpactC, D, Score_> (Score_ constraintWeight, ToIntQuadFunction<A, B, C, D> matchWeigher, ScoreImpactType scoreImpactType) - Specified by:
innerImpactin interfaceInnerQuadConstraintStream<Solution_,A, B, C>
-
innerImpact
public <Score_ extends Score<Score_>> QuadConstraintBuilder<A,B, innerImpactC, D, Score_> (Score_ constraintWeight, ToLongQuadFunction<A, B, C, D> matchWeigher, ScoreImpactType scoreImpactType) - Specified by:
innerImpactin interfaceInnerQuadConstraintStream<Solution_,A, B, C>
-
innerImpact
public <Score_ extends Score<Score_>> QuadConstraintBuilder<A,B, innerImpactC, D, Score_> (Score_ constraintWeight, QuadFunction<A, B, C, D, BigDecimal> matchWeigher, ScoreImpactType scoreImpactType) - Specified by:
innerImpactin interfaceInnerQuadConstraintStream<Solution_,A, B, C>
-
getDefaultJustificationMapping
protected final PentaFunction<A,B, getDefaultJustificationMapping()C, D, Score<?>, DefaultConstraintJustification> - Specified by:
getDefaultJustificationMappingin classAbstractConstraintStream<Solution_>
-
getDefaultIndictedObjectsMapping
- Specified by:
getDefaultIndictedObjectsMappingin classAbstractConstraintStream<Solution_>
-