Class BavetAbstractBiConstraintStream<Solution_,A,B>
- All Implemented Interfaces:
BiConstraintStream<A,,B> ConstraintStream,InnerBiConstraintStream<A,B>
- Direct Known Subclasses:
BavetAftBridgeBiConstraintStream,BavetBiConcatBiConstraintStream,BavetForeBridgeBiConstraintStream,BavetJoinBiConstraintStream,BavetUniConcatBiConstraintStream
-
Field Summary
Fields inherited from class ai.timefold.solver.core.impl.score.stream.bavet.common.BavetAbstractConstraintStream
childStreamList, constraintFactory, parent -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBavetAbstractBiConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, BavetAbstractConstraintStream<Solution_> parent) protectedBavetAbstractBiConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, RetrievalSemantics retrievalSemantics) -
Method Summary
Modifier and TypeMethodDescriptionconcat(BiConstraintStream<A, B> otherStream) Returns a newBiConstraintStreamcontaining all the tuples of both thisBiConstraintStreamand the providedBiConstraintStream.<C,D> QuadConstraintStream<A, B, C, D> concat(QuadConstraintStream<A, B, C, D> otherStream, BiFunction<A, B, C> paddingFunctionC, BiFunction<A, B, D> paddingFunctionD) Returns a newQuadConstraintStreamcontaining all the tuples of both thisBiConstraintStreamand the providedQuadConstraintStream.<C> TriConstraintStream<A,B, C> concat(TriConstraintStream<A, B, C> otherStream, BiFunction<A, B, C> paddingFunction) Returns a newTriConstraintStreamcontaining all the tuples of both thisBiConstraintStreamand the providedTriConstraintStream.Returns a newBiConstraintStreamcontaining all the tuples of both thisBiConstraintStreamand the providedUniConstraintStream.distinct()Transforms the stream in such a way that all the tuples going through it are distinct.<ResultC_> TriConstraintStream<A,B, ResultC_> expand(BiFunction<A, B, ResultC_> mapping) Adds a fact to the end of the tuple, increasing the cardinality of the stream.<ResultC_,ResultD_>
QuadConstraintStream<A,B, ResultC_, ResultD_> expand(BiFunction<A, B, ResultC_> mappingC, BiFunction<A, B, ResultD_> mappingD) Adds two facts to the end of the tuple, increasing the cardinality of the stream.filter(BiPredicate<A, B> predicate) Exhaustively test each tuple of facts against theBiPredicateand match ifBiPredicate.test(Object, Object)returns true.<ResultB_> BiConstraintStream<A,ResultB_> flattenLast(Function<B, Iterable<ResultB_>> mapping) Takes each tuple and applies a mapping on the last fact, which turns it intoIterable.protected final BiFunction<A,B, Collection<?>> protected final TriFunction<A,B, Score<?>, DefaultConstraintJustification> <ResultContainer_,Result_>
UniConstraintStream<Result_>groupBy(BiConstraintCollector<A, B, ResultContainer_, Result_> collector) Runs all tuples of the stream through a given @BiConstraintCollectorand converts them into a newUniConstraintStreamwhich only has a single tuple, the result of applyingBiConstraintCollector.<ResultContainerA_,ResultA_, ResultContainerB_, ResultB_>
BiConstraintStream<ResultA_,ResultB_> groupBy(BiConstraintCollector<A, B, ResultContainerA_, ResultA_> collectorA, BiConstraintCollector<A, B, ResultContainerB_, ResultB_> collectorB) Convert theBiConstraintStreamto aBiConstraintStream, containing only a single tuple, the result of applying twoBiConstraintCollectors.<ResultContainerA_,ResultA_, ResultContainerB_, ResultB_, ResultContainerC_, ResultC_>
TriConstraintStream<ResultA_,ResultB_, ResultC_> groupBy(BiConstraintCollector<A, B, ResultContainerA_, ResultA_> collectorA, BiConstraintCollector<A, B, ResultContainerB_, ResultB_> collectorB, BiConstraintCollector<A, B, ResultContainerC_, ResultC_> collectorC) Convert theBiConstraintStreamto aTriConstraintStream, containing only a single tuple, the result of applying threeBiConstraintCollectors.<ResultContainerA_,ResultA_, ResultContainerB_, ResultB_, ResultContainerC_, ResultC_, ResultContainerD_, ResultD_>
QuadConstraintStream<ResultA_,ResultB_, ResultC_, ResultD_> groupBy(BiConstraintCollector<A, B, ResultContainerA_, ResultA_> collectorA, BiConstraintCollector<A, B, ResultContainerB_, ResultB_> collectorB, BiConstraintCollector<A, B, ResultContainerC_, ResultC_> collectorC, BiConstraintCollector<A, B, ResultContainerD_, ResultD_> collectorD) Convert theBiConstraintStreamto aQuadConstraintStream, containing only a single tuple, the result of applying fourBiConstraintCollectors.<GroupKey_>
UniConstraintStream<GroupKey_>groupBy(BiFunction<A, B, GroupKey_> groupKeyMapping) Convert theBiConstraintStreamto 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(BiFunction<A, B, GroupKey_> groupKeyMapping, BiConstraintCollector<A, B, ResultContainer_, Result_> collector) Convert theBiConstraintStreamto a differentBiConstraintStream, consisting of unique tuples.<GroupKey_,ResultContainerB_, ResultB_, ResultContainerC_, ResultC_>
TriConstraintStream<GroupKey_,ResultB_, ResultC_> groupBy(BiFunction<A, B, GroupKey_> groupKeyMapping, BiConstraintCollector<A, B, ResultContainerB_, ResultB_> collectorB, BiConstraintCollector<A, B, ResultContainerC_, ResultC_> collectorC) Convert theBiConstraintStreamto aTriConstraintStream, consisting of unique tuples with three facts.<GroupKey_,ResultContainerB_, ResultB_, ResultContainerC_, ResultC_, ResultContainerD_, ResultD_>
QuadConstraintStream<GroupKey_,ResultB_, ResultC_, ResultD_> groupBy(BiFunction<A, B, GroupKey_> groupKeyMapping, BiConstraintCollector<A, B, ResultContainerB_, ResultB_> collectorB, BiConstraintCollector<A, B, ResultContainerC_, ResultC_> collectorC, BiConstraintCollector<A, B, ResultContainerD_, ResultD_> collectorD) Convert theBiConstraintStreamto aQuadConstraintStream, consisting of unique tuples with four facts.<GroupKeyA_,GroupKeyB_>
BiConstraintStream<GroupKeyA_,GroupKeyB_> groupBy(BiFunction<A, B, GroupKeyA_> groupKeyAMapping, BiFunction<A, B, GroupKeyB_> groupKeyBMapping) Convert theBiConstraintStreamto a differentBiConstraintStream, consisting of unique tuples.<GroupKeyA_,GroupKeyB_, ResultContainer_, Result_>
TriConstraintStream<GroupKeyA_,GroupKeyB_, Result_> groupBy(BiFunction<A, B, GroupKeyA_> groupKeyAMapping, BiFunction<A, B, GroupKeyB_> groupKeyBMapping, BiConstraintCollector<A, B, ResultContainer_, Result_> collector) Combines the semantics ofBiConstraintStream.groupBy(BiFunction, BiFunction)andBiConstraintStream.groupBy(BiConstraintCollector).<GroupKeyA_,GroupKeyB_, ResultContainerC_, ResultC_, ResultContainerD_, ResultD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_, ResultC_, ResultD_> groupBy(BiFunction<A, B, GroupKeyA_> groupKeyAMapping, BiFunction<A, B, GroupKeyB_> groupKeyBMapping, BiConstraintCollector<A, B, ResultContainerC_, ResultC_> collectorC, BiConstraintCollector<A, B, ResultContainerD_, ResultD_> collectorD) Combines the semantics ofBiConstraintStream.groupBy(BiFunction, BiFunction)andBiConstraintStream.groupBy(BiConstraintCollector).<GroupKeyA_,GroupKeyB_, GroupKeyC_>
TriConstraintStream<GroupKeyA_,GroupKeyB_, GroupKeyC_> groupBy(BiFunction<A, B, GroupKeyA_> groupKeyAMapping, BiFunction<A, B, GroupKeyB_> groupKeyBMapping, BiFunction<A, B, GroupKeyC_> groupKeyCMapping) Convert theBiConstraintStreamto aTriConstraintStream, consisting of unique tuples with three facts.<GroupKeyA_,GroupKeyB_, GroupKeyC_, ResultContainerD_, ResultD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_, GroupKeyC_, ResultD_> groupBy(BiFunction<A, B, GroupKeyA_> groupKeyAMapping, BiFunction<A, B, GroupKeyB_> groupKeyBMapping, BiFunction<A, B, GroupKeyC_> groupKeyCMapping, BiConstraintCollector<A, B, ResultContainerD_, ResultD_> collectorD) Combines the semantics ofBiConstraintStream.groupBy(BiFunction, BiFunction)andBiConstraintStream.groupBy(BiConstraintCollector).<GroupKeyA_,GroupKeyB_, GroupKeyC_, GroupKeyD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_, GroupKeyC_, GroupKeyD_> groupBy(BiFunction<A, B, GroupKeyA_> groupKeyAMapping, BiFunction<A, B, GroupKeyB_> groupKeyBMapping, BiFunction<A, B, GroupKeyC_> groupKeyCMapping, BiFunction<A, B, GroupKeyD_> groupKeyDMapping) Convert theBiConstraintStreamto aQuadConstraintStream, consisting of unique tuples with four facts.final <C> BiConstraintStream<A,B> ifExists(UniConstraintStream<C> otherStream, TriJoiner<A, B, C>... joiners) As defined byBiConstraintStream.ifExists(UniConstraintStream, TriJoiner).final <C> BiConstraintStream<A,B> ifNotExists(UniConstraintStream<C> otherStream, TriJoiner<A, B, C>... joiners) <Score_ extends Score<Score_>>
BiConstraintBuilder<A,B, Score_> innerImpact(Score_ constraintWeight, BiFunction<A, B, BigDecimal> matchWeigher, ScoreImpactType scoreImpactType) <Score_ extends Score<Score_>>
BiConstraintBuilder<A,B, Score_> innerImpact(Score_ constraintWeight, ToIntBiFunction<A, B> matchWeigher, ScoreImpactType scoreImpactType) <Score_ extends Score<Score_>>
BiConstraintBuilder<A,B, Score_> innerImpact(Score_ constraintWeight, ToLongBiFunction<A, B> matchWeigher, ScoreImpactType scoreImpactType) final <C> TriConstraintStream<A,B, C> join(UniConstraintStream<C> otherStream, TriJoiner<A, B, C>... joiners) As defined byBiConstraintStream.join(Class, TriJoiner).<ResultA_> UniConstraintStream<ResultA_>map(BiFunction<A, B, ResultA_> mapping) As defined byUniConstraintStream.map(Function).<ResultA_,ResultB_>
BiConstraintStream<ResultA_,ResultB_> map(BiFunction<A, B, ResultA_> mappingA, BiFunction<A, B, ResultB_> mappingB) As defined byBiConstraintStream.map(BiFunction), only resulting inBiConstraintStream.<ResultA_,ResultB_, ResultC_>
TriConstraintStream<ResultA_,ResultB_, ResultC_> map(BiFunction<A, B, ResultA_> mappingA, BiFunction<A, B, ResultB_> mappingB, BiFunction<A, B, ResultC_> mappingC) As defined byBiConstraintStream.map(BiFunction), only resulting inTriConstraintStream.<ResultA_,ResultB_, ResultC_, ResultD_>
QuadConstraintStream<ResultA_,ResultB_, ResultC_, ResultD_> map(BiFunction<A, B, ResultA_> mappingA, BiFunction<A, B, ResultB_> mappingB, BiFunction<A, B, ResultC_> mappingC, BiFunction<A, B, ResultD_> mappingD) As defined byBiConstraintStream.map(BiFunction), 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.bi.BiConstraintStream
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, join, join, join, join, join, join, join, join, join, join, 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, rewardLongMethods inherited from interface ai.timefold.solver.core.api.score.stream.ConstraintStream
getConstraintFactoryMethods inherited from interface ai.timefold.solver.core.impl.score.stream.common.bi.InnerBiConstraintStream
getRetrievalSemantics, guaranteesDistinct, ifExists, ifExistsIncludingUnassigned, ifNotExists, ifNotExistsIncludingUnassigned, impact, impact, impact, impactBigDecimal, impactConfigurable, impactConfigurableBigDecimal, impactConfigurableLong, impactLong, join, penalize, penalize, penalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurable, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, reward, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurable, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLong
-
Constructor Details
-
BavetAbstractBiConstraintStream
protected BavetAbstractBiConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, BavetAbstractConstraintStream<Solution_> parent) -
BavetAbstractBiConstraintStream
protected BavetAbstractBiConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, RetrievalSemantics retrievalSemantics)
-
-
Method Details
-
filter
Description copied from interface:BiConstraintStreamExhaustively test each tuple of facts against theBiPredicateand match ifBiPredicate.test(Object, Object)returns true.Important: This is slower and less scalable than
UniConstraintStream.join(UniConstraintStream, BiJoiner)with a properBiJoinerpredicate (such asJoiners.equal(Function, Function), because the latter applies hashing and/or indexing, so it doesn't create every combination just to filter it out.- Specified by:
filterin interfaceBiConstraintStream<Solution_,A> - Parameters:
predicate- never null- Returns:
- never null
-
join
@SafeVarargs public final <C> TriConstraintStream<A,B, joinC> (UniConstraintStream<C> otherStream, TriJoiner<A, B, C>... joiners) Description copied from interface:BiConstraintStreamAs defined byBiConstraintStream.join(Class, TriJoiner). 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 4BiJoinerparameters.- Specified by:
joinin interfaceBiConstraintStream<Solution_,A> - Type Parameters:
C- the type of the third matched fact- Parameters:
otherStream- never nulljoiners- never null- Returns:
- never null, a stream that matches every combination of [A, B] and C for which all the
joinersare true
-
ifExists
@SafeVarargs public final <C> BiConstraintStream<A,B> ifExists(UniConstraintStream<C> otherStream, TriJoiner<A, B, C>... joiners) Description copied from interface:BiConstraintStreamAs defined byBiConstraintStream.ifExists(UniConstraintStream, TriJoiner). 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 4TriJoinerparameters.- Specified by:
ifExistsin interfaceBiConstraintStream<Solution_,A> - Type Parameters:
C- the type of the third matched fact- Parameters:
otherStream- never nulljoiners- never null- Returns:
- never null, a stream that matches every pair of A and B where C exists for which the
TriJoiners are true
-
ifNotExists
@SafeVarargs public final <C> BiConstraintStream<A,B> ifNotExists(UniConstraintStream<C> otherStream, TriJoiner<A, B, C>... joiners) Description copied from interface:BiConstraintStreamAs defined byBiConstraintStream.ifNotExists(UniConstraintStream, TriJoiner). 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 4TriJoinerparameters.- Specified by:
ifNotExistsin interfaceBiConstraintStream<Solution_,A> - Type Parameters:
C- the type of the third matched fact- Parameters:
otherStream- never nulljoiners- never null- Returns:
- never null, a stream that matches every pair of A and B where C does not exist for which the
TriJoiners are true
-
groupBy
public <ResultContainer_,Result_> UniConstraintStream<Result_> groupBy(BiConstraintCollector<A, B, ResultContainer_, Result_> collector) Description copied from interface:BiConstraintStreamRuns all tuples of the stream through a given @BiConstraintCollectorand converts them into a newUniConstraintStreamwhich only has a single tuple, the result of applyingBiConstraintCollector.- Specified by:
groupByin interfaceBiConstraintStream<Solution_,A> - 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(BiConstraintCollector<A, B, ResultContainerA_, ResultA_> collectorA, BiConstraintCollector<A, B, ResultContainerB_, ResultB_> collectorB) Description copied from interface:BiConstraintStreamConvert theBiConstraintStreamto aBiConstraintStream, containing only a single tuple, the result of applying twoBiConstraintCollectors.- Specified by:
groupByin interfaceBiConstraintStream<Solution_,A> - 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_> (BiConstraintCollector<A, B, ResultContainerA_, ResultA_> collectorA, BiConstraintCollector<A, B, ResultContainerB_, ResultB_> collectorB, BiConstraintCollector<A, B, ResultContainerC_, ResultC_> collectorC) Description copied from interface:BiConstraintStreamConvert theBiConstraintStreamto aTriConstraintStream, containing only a single tuple, the result of applying threeBiConstraintCollectors.- Specified by:
groupByin interfaceBiConstraintStream<Solution_,A> - 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_> (BiConstraintCollector<A, B, ResultContainerA_, ResultA_> collectorA, BiConstraintCollector<A, B, ResultContainerB_, ResultB_> collectorB, BiConstraintCollector<A, B, ResultContainerC_, ResultC_> collectorC, BiConstraintCollector<A, B, ResultContainerD_, ResultD_> collectorD) Description copied from interface:BiConstraintStreamConvert theBiConstraintStreamto aQuadConstraintStream, containing only a single tuple, the result of applying fourBiConstraintCollectors.- Specified by:
groupByin interfaceBiConstraintStream<Solution_,A> - 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(BiFunction<A, B, GroupKey_> groupKeyMapping) Description copied from interface:BiConstraintStreamConvert theBiConstraintStreamto 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 interfaceBiConstraintStream<Solution_,A> - 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_,ResultContainerB_, TriConstraintStream<GroupKey_,ResultB_, ResultContainerC_, ResultC_> ResultB_, groupByResultC_> (BiFunction<A, B, GroupKey_> groupKeyMapping, BiConstraintCollector<A, B, ResultContainerB_, ResultB_> collectorB, BiConstraintCollector<A, B, ResultContainerC_, ResultC_> collectorC) Description copied from interface:BiConstraintStreamConvert theBiConstraintStreamto 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
BiConstraintCollectorapplied on all incoming tuples with the same first fact.- Specified by:
groupByin interfaceBiConstraintStream<Solution_,A> - 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_> (BiFunction<A, B, GroupKey_> groupKeyMapping, BiConstraintCollector<A, B, ResultContainerB_, ResultB_> collectorB, BiConstraintCollector<A, B, ResultContainerC_, ResultC_> collectorC, BiConstraintCollector<A, B, ResultContainerD_, ResultD_> collectorD) Description copied from interface:BiConstraintStreamConvert theBiConstraintStreamto 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
BiConstraintCollectorapplied on all incoming tuples with the same first fact.- Specified by:
groupByin interfaceBiConstraintStream<Solution_,A> - 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(BiFunction<A, B, GroupKey_> groupKeyMapping, BiConstraintCollector<A, B, ResultContainer_, Result_> collector) Description copied from interface:BiConstraintStreamConvert theBiConstraintStreamto a differentBiConstraintStream, 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
BiConstraintCollectorapplied on all incoming tuples with the same first fact.- Specified by:
groupByin interfaceBiConstraintStream<Solution_,A> - 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(BiFunction<A, B, GroupKeyA_> groupKeyAMapping, BiFunction<A, B, GroupKeyB_> groupKeyBMapping) Description copied from interface:BiConstraintStreamConvert theBiConstraintStreamto a differentBiConstraintStream, 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 interfaceBiConstraintStream<Solution_,A> - 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_> (BiFunction<A, B, GroupKeyA_> groupKeyAMapping, BiFunction<A, B, GroupKeyB_> groupKeyBMapping, BiConstraintCollector<A, B, ResultContainer_, Result_> collector) Description copied from interface:BiConstraintStreamCombines the semantics ofBiConstraintStream.groupBy(BiFunction, BiFunction)andBiConstraintStream.groupBy(BiConstraintCollector). That is, the first and second facts in the tuple follow theBiConstraintStream.groupBy(BiFunction, BiFunction)semantics, and the third fact is the result of applyingBiConstraintCollector.finisher()on all the tuples of the originalUniConstraintStreamthat belong to the group.- Specified by:
groupByin interfaceBiConstraintStream<Solution_,A> - 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_> (BiFunction<A, B, GroupKeyA_> groupKeyAMapping, BiFunction<A, B, GroupKeyB_> groupKeyBMapping, BiConstraintCollector<A, B, ResultContainerC_, ResultC_> collectorC, BiConstraintCollector<A, B, ResultContainerD_, ResultD_> collectorD) Description copied from interface:BiConstraintStreamCombines the semantics ofBiConstraintStream.groupBy(BiFunction, BiFunction)andBiConstraintStream.groupBy(BiConstraintCollector). That is, the first and second facts in the tuple follow theBiConstraintStream.groupBy(BiFunction, BiFunction)semantics. The third fact is the result of applying the firstBiConstraintCollector.finisher()on all the tuples of the originalBiConstraintStreamthat belong to the group. The fourth fact is the result of applying the secondBiConstraintCollector.finisher()on all the tuples of the originalBiConstraintStreamthat belong to the group- Specified by:
groupByin interfaceBiConstraintStream<Solution_,A> - 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_> (BiFunction<A, B, GroupKeyA_> groupKeyAMapping, BiFunction<A, B, GroupKeyB_> groupKeyBMapping, BiFunction<A, B, GroupKeyC_> groupKeyCMapping) Description copied from interface:BiConstraintStreamConvert theBiConstraintStreamto 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 interfaceBiConstraintStream<Solution_,A> - 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_> (BiFunction<A, B, GroupKeyA_> groupKeyAMapping, BiFunction<A, B, GroupKeyB_> groupKeyBMapping, BiFunction<A, B, GroupKeyC_> groupKeyCMapping, BiConstraintCollector<A, B, ResultContainerD_, ResultD_> collectorD) Description copied from interface:BiConstraintStreamCombines the semantics ofBiConstraintStream.groupBy(BiFunction, BiFunction)andBiConstraintStream.groupBy(BiConstraintCollector). That is, the first three facts in the tuple follow theBiConstraintStream.groupBy(BiFunction, BiFunction)semantics. The final fact is the result of applying the firstBiConstraintCollector.finisher()on all the tuples of the originalBiConstraintStreamthat belong to the group.- Specified by:
groupByin interfaceBiConstraintStream<Solution_,A> - 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_> (BiFunction<A, B, GroupKeyA_> groupKeyAMapping, BiFunction<A, B, GroupKeyB_> groupKeyBMapping, BiFunction<A, B, GroupKeyC_> groupKeyCMapping, BiFunction<A, B, GroupKeyD_> groupKeyDMapping) Description copied from interface:BiConstraintStreamConvert theBiConstraintStreamto 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 interfaceBiConstraintStream<Solution_,A> - 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
-
distinct
Description copied from interface:BiConstraintStreamTransforms the stream in such a way that all the tuples going through it are distinct. (No two result tuples areequal.)By default, tuples going through a constraint stream are distinct. However, operations such as
BiConstraintStream.map(BiFunction)may create a stream which breaks that promise. By calling this method on such a stream, duplicate copies of the same tuple are omitted at a performance cost.- Specified by:
distinctin interfaceBiConstraintStream<Solution_,A> - Specified by:
distinctin interfaceInnerBiConstraintStream<Solution_,A> - Returns:
- never null
-
concat
public BiConstraintStream<A,B> concat(UniConstraintStream<A> otherStream, Function<A, B> paddingFunction) Description copied from interface:BiConstraintStreamReturns a newBiConstraintStreamcontaining all the tuples of both thisBiConstraintStreamand the providedUniConstraintStream. TheUniConstraintStreamtuples will be padded from the right by the result of the padding function.For instance, if this stream consists of
[(A1, A2), (B1, B2), (C1, C2)]and the other stream consists of[C, D, E],this.concat(other, a -> null)will consist of[(A1, A2), (B1, B2), (C1, C2), (C, null), (D, null), (E, null)].This operation can be thought of as an or between streams.
- Specified by:
concatin interfaceBiConstraintStream<Solution_,A> - Parameters:
otherStream- never nullpaddingFunction- never null, function to find the padding for the second fact- Returns:
- never null
-
concat
Description copied from interface:BiConstraintStreamReturns a newBiConstraintStreamcontaining all the tuples of both thisBiConstraintStreamand the providedBiConstraintStream. Tuples in both thisBiConstraintStreamand the providedBiConstraintStreamwill appear at least twice.For instance, if this stream consists of
[(A, 1), (B, 2), (C, 3)]and the other stream consists of[(C, 3), (D, 4), (E, 5)],this.concat(other)will consist of[(A, 1), (B, 2), (C, 3), (C, 3), (D, 4), (E, 5)].This operation can be thought of as an or between streams.
- Specified by:
concatin interfaceBiConstraintStream<Solution_,A> - Parameters:
otherStream- never null- Returns:
- never null
-
concat
public <C> TriConstraintStream<A,B, concatC> (TriConstraintStream<A, B, C> otherStream, BiFunction<A, B, C> paddingFunction) Description copied from interface:BiConstraintStreamReturns a newTriConstraintStreamcontaining all the tuples of both thisBiConstraintStreamand the providedTriConstraintStream. TheBiConstraintStreamtuples will be padded from the right by the result of the padding function.For instance, if this stream consists of
[(A1, A2), (B1, B2), (C1, C2)]and the other stream consists of[(C1, C2, C3), (D1, D2, D3), (E1, E2, E3)],this.concat(other, (a, b) -> null)will consist of[(A1, A2, null), (B1, B2, null), (C1, C2, null), (C1, C2, C3), (D1, D2, D3), (E1, E2, E3)].This operation can be thought of as an or between streams.
- Specified by:
concatin interfaceBiConstraintStream<Solution_,A> - Parameters:
otherStream- never nullpaddingFunction- never null, function to find the padding for the third fact- Returns:
- never null
-
concat
public <C,D> QuadConstraintStream<A,B, concatC, D> (QuadConstraintStream<A, B, C, D> otherStream, BiFunction<A, B, C> paddingFunctionC, BiFunction<A, B, D> paddingFunctionD) Description copied from interface:BiConstraintStreamReturns a newQuadConstraintStreamcontaining all the tuples of both thisBiConstraintStreamand the providedQuadConstraintStream. TheBiConstraintStreamtuples will be padded from the right by the results of the padding functions.For instance, if this stream consists of
[(A1, A2), (B1, B2), (C1, C2)]and the other stream consists of[(C1, C2, C3, C4), (D1, D2, D3, D4), (E1, E2, E3, E4)],this.concat(other, (a, b) -> null, (a, b) -> null)will consist of[(A1, A2, null, null), (B1, B2, null, null), (C1, C2, null, null), (C1, C2, C3, C4), (D1, D2, D3, D4), (E1, E2, E3, E4)].This operation can be thought of as an or between streams.
- Specified by:
concatin interfaceBiConstraintStream<Solution_,A> - Parameters:
otherStream- never nullpaddingFunctionC- 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
-
map
Description copied from interface:BiConstraintStreamAs defined byUniConstraintStream.map(Function).- Specified by:
mapin interfaceBiConstraintStream<Solution_,A> - 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(BiFunction<A, B, ResultA_> mappingA, BiFunction<A, B, ResultB_> mappingB) Description copied from interface:BiConstraintStreamAs defined byBiConstraintStream.map(BiFunction), only resulting inBiConstraintStream.- Specified by:
mapin interfaceBiConstraintStream<Solution_,A> - 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_> (BiFunction<A, B, ResultA_> mappingA, BiFunction<A, B, ResultB_> mappingB, BiFunction<A, B, ResultC_> mappingC) Description copied from interface:BiConstraintStreamAs defined byBiConstraintStream.map(BiFunction), only resulting inTriConstraintStream.- Specified by:
mapin interfaceBiConstraintStream<Solution_,A> - 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_> (BiFunction<A, B, ResultA_> mappingA, BiFunction<A, B, ResultB_> mappingB, BiFunction<A, B, ResultC_> mappingC, BiFunction<A, B, ResultD_> mappingD) Description copied from interface:BiConstraintStreamAs defined byBiConstraintStream.map(BiFunction), only resulting inQuadConstraintStream.- Specified by:
mapin interfaceBiConstraintStream<Solution_,A> - 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 <ResultB_> BiConstraintStream<A,ResultB_> flattenLast(Function<B, Iterable<ResultB_>> mapping) Description copied from interface:BiConstraintStreamTakes each tuple and applies a mapping on the last fact, which turns it intoIterable. Returns a constraint stream consisting of tuples of the first fact and the contents of theIterableone after another. In other words, it will replace the current tuple with new tuples, a cartesian product of A and the individual items from theIterable.This may produce a stream with duplicate tuples. See
BiConstraintStream.distinct()for details.In cases where the last fact is already
Iterable, useFunction.identity()as the argument.Simple example: assuming a constraint stream of
(PersonName, Person)[(Ann, (name = Ann, roles = [USER, ADMIN])), (Beth, (name = Beth, roles = [USER])), (Cathy, (name = Cathy, roles = [ADMIN, AUDITOR]))], callingflattenLast(Person::getRoles)on such stream will produce a stream of[(Ann, USER), (Ann, ADMIN), (Beth, USER), (Cathy, ADMIN), (Cathy, AUDITOR)].- Specified by:
flattenLastin interfaceBiConstraintStream<Solution_,A> - Type Parameters:
ResultB_- 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
-
expand
Description copied from interface:BiConstraintStreamAdds a fact to the end of the tuple, increasing the cardinality of the stream. Useful for storing results of expensive computations on the original tuple.Use with caution, as the benefits of caching computation may be outweighed by increased memory allocation rates coming from tuple creation. If more than two facts are to be added, prefer
BiConstraintStream.expand(BiFunction, BiFunction).- Specified by:
expandin interfaceBiConstraintStream<Solution_,A> - Type Parameters:
ResultC_- type of the final fact of the new tuple- Parameters:
mapping- function to produce the new fact from the original tuple- Returns:
- never null
-
expand
public <ResultC_,ResultD_> QuadConstraintStream<A,B, expandResultC_, ResultD_> (BiFunction<A, B, ResultC_> mappingC, BiFunction<A, B, ResultD_> mappingD) Description copied from interface:BiConstraintStreamAdds two facts to the end of the tuple, increasing the cardinality of the stream. Useful for storing results of expensive computations on the original tuple.Use with caution, as the benefits of caching computation may be outweighed by increased memory allocation rates coming from tuple creation.
- Specified by:
expandin interfaceBiConstraintStream<Solution_,A> - Type Parameters:
ResultC_- type of the third fact of the new tupleResultD_- type of the final fact of the new tuple- Parameters:
mappingC- function to produce the new third fact from the original tuplemappingD- function to produce the new final fact from the original tuple- Returns:
- never null
-
innerImpact
public <Score_ extends Score<Score_>> BiConstraintBuilder<A,B, innerImpactScore_> (Score_ constraintWeight, ToIntBiFunction<A, B> matchWeigher, ScoreImpactType scoreImpactType) - Specified by:
innerImpactin interfaceInnerBiConstraintStream<Solution_,A>
-
innerImpact
public <Score_ extends Score<Score_>> BiConstraintBuilder<A,B, innerImpactScore_> (Score_ constraintWeight, ToLongBiFunction<A, B> matchWeigher, ScoreImpactType scoreImpactType) - Specified by:
innerImpactin interfaceInnerBiConstraintStream<Solution_,A>
-
innerImpact
public <Score_ extends Score<Score_>> BiConstraintBuilder<A,B, innerImpactScore_> (Score_ constraintWeight, BiFunction<A, B, BigDecimal> matchWeigher, ScoreImpactType scoreImpactType) - Specified by:
innerImpactin interfaceInnerBiConstraintStream<Solution_,A>
-
getDefaultJustificationMapping
protected final TriFunction<A,B, getDefaultJustificationMapping()Score<?>, DefaultConstraintJustification> - Specified by:
getDefaultJustificationMappingin classAbstractConstraintStream<Solution_>
-
getDefaultIndictedObjectsMapping
- Specified by:
getDefaultIndictedObjectsMappingin classAbstractConstraintStream<Solution_>
-